is there any short article introducing all "tricks" to struct the c++ project to make it compile faster?
I have a big c++ project, which takes maybe 10 times longer to compile with with a small change, compared with c# projects with similar size.
thanks
You should probably use the Makefile in an intelligent way.
If you have many .C and .h files, every time you change one *.C file, you should not compile all the files but just that .C file.
But, if a .h is changed you need to compile all the files which use that header file.
Likewise you can reduce the compile time.
If you are not using Makefile, learn how to use it.
i use vstudio in windows. basically, from what you say, i see rule 1 is try to use forward class in header file, and try to include header in cpp file, correct? thanks
One way I know is to remove unnecessary included header files from header files. A simple declaration can work instead of including entire header file.
//in A.h
#include "X.h"//This is not needed
//Class X will suffice