I need help compiling my C++ program on vim. What would I use in my command line
ID: 3843705 • Letter: I
Question
I need help compiling my C++ program on vim. What would I use in my command line to get the program to run properly with these filenames. My program compiles with code::blocks so I don’t think the errors are within the programs.
Node.hpp
NodeMain.cpp
textFile.txt
Makefile
Thank you
//---------------------------------------------------------
Here are the textFile contents:
22 44 66 88
//-------------------------------------------------------------
Here are the Makefile contents:
all: node
node: NodeMain.o
g++ NodeMain.o -o node
NodeMain.o: NodeMain.cpp
g++ -c NodeMain.cpp
clean:
rm .o node
Explanation / Answer
To compile and run the c++ program in vim, we have to follow these two ways..
2) second way..
$ g++ NodeMain .cpp -o NodeMain
$ ./NodeMain
Run using either of this way... it will work.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.