how to compile cpp program using g++

Feb 7, 2013 at 8:00am
Hi everyone, I have so many cpp programs. I used makefile to link all object files together. Inside so many programs, it has one program that i wanna run now. How to run it? How to make executable file for my program? thanks
Feb 7, 2013 at 11:39pm
I'm not sure I understand you correctly; you have compiled & linked several programs together into one big program? If you could elaborate more, that would be very helpful.
Feb 8, 2013 at 1:07am
closed account (Dy7SLyTq)
g++ -o *.cpp *
Feb 8, 2013 at 5:03am
In the terminal, navigate to the directory containing your files with cd. If your .cpp file was called test.cpp and you wanted the executable to be called test, you'd enter the following command into terminal:
 
g++ test.cpp -o test

To run your program, enter
 
./test
Topic archived. No new replies allowed.