Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help compiling my c++ program on vim. What would I use in my command line

ID: 3843720 • 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.

recursiveMain.cpp

recursive.hpp

Makefile

//---------------------------------------------------------------------------

Here is my Makefile:

all: recursive

recursive: recursiveMain.o

              g++ recursiveMain.o -o recursive

recursiveMain.o: recursiveMain.cpp

              g++ -c recursiveMain.cpp

clean: rm .o recursive

Thank you!

Explanation / Answer

first of all check the that you in the folder that your compiling and all the files are in the same folder

in the target include both the output file and the recursive.h in the code section this is used to combine all the files to executable file

the first thing about make file is that all the c++ files are combined to form a executable file

recursiveMain.o: recursiveMain.cpp recursive.h //this is missing in the code hope it helped

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote