Sign in to follow this  
Tradone

Compiling.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this