Compiling.

Started by
4 comments, last by Tradone 18 years ago
Whenever I compile, I use the whole syntax. 151# g++ -o new_shenu.cgi new_shenu.cpp Algorithms.cpp Path.cpp Cookie.cpp Parameter.cpp now, there are more cpp files to compile. I think for this project there's going to be about 20~30 cpp files. and every time I need to recompile, it takes about 20 seconds when it takes long, is there a way to hasten this compilation procedure? like creating the object files manually and only linking those that have been changed? this is my first time dividing my code into serveral files. Thanks. any advice will be appreciated.
Advertisement
gnu make

makefiles are typically confusing at first, but it's exactly what you're looking for.
This space for rent.
If you have foo.cpp, bar.cpp, and baz.cpp

g++ -c foo.cpp
g++ -c bar.cpp
g++ -c baz.cpp

g++ foo.o bar.o baz.o

Then you make a change to foo.cpp

g++ foo.cpp bar.o baz.o

See also: Make
this thread may interest you.
This space for rent.
See also: SCons
thanks for the lightning quick replies :D

This topic is closed to new replies.

Advertisement