[C++] Compilation and default values problem.

Started by
13 comments, last by Zahlman 14 years, 2 months ago
You can turn of the build dependency engine, which will cause it to rebuild all .cpp files that include a header file you've modified. In your project properties, under C/C++, Code Generation, change the "Enable Minimal Rebuild" option to 'No'.

In general, you shouldn't have to do this, though, since the Visual Studio engine is usually pretty good. The main things that tend to confuse it is if your files have timestamps that are in the future or really far in the past, You might want to just double-check that. There could also be preprocessor definitions which confuse the dependency engine, I'm not too sure... but definitely the option I mentioned above will work around the problem.
Advertisement
Thanks Codeka, I changed that and the application compiles and runs correctly.
Aaah, "Minimal Rebuild" has reared its ugly head! I totally forgot about that one, because I never turn it on...
I'm posting because I've experienced a similar, though different problem, as far as the building dependencies goes, although in quite a different fashion. This was like a year ago, but lesson learned. I was working on a rather large project, where there were files that required a complete build of the project, a lot longer than the minimal rebuild necessary.

Without touching "World.h" the compiler would detect it had changed and needed to be recompiled, which meant every file needed to be compiled. This took much more time than needed, especially when World.h shouldn't require that. The problem ended up being the fact that I had changed my computers date, accidentally while looking at the calendar, and the date/time of the World.h was changed. Therefor the compiler always thought the file was new, and needed to be rebuilt.

The same thing can happen in reverse; the compiler not building a file even when you are making changes, likely because of the same effect - although I don't know the specifics of this case I've experienced it as well. The previous case is easier since the time you last saved the file is newer than the current time and it thinks it needs to be rebuilt.

Just a heads up for people who get attracted to this thread from the contents within.
Or you could, you know, learn how makefiles work... :) (Although I have no idea how you'd make an IDE like VC++ talk to external build tools like automake :/)

This topic is closed to new replies.

Advertisement