Compiling.
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.
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
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 topic is closed to new replies.
Advertisement
Popular Topics
Advertisement