How to work around Visual Studio Compiler crashes

前端 未结 3 1613
执笔经年
执笔经年 2021-01-11 15:25

We have a large Visual Studio 2005 C++/Mfc solution, 1 project with around 1300 source files (so about 650 .h and 650 .cpp files). We also use Boost and a few other librarie

相关标签:
3条回答
  • 2021-01-11 15:37

    I'd have to agree with Goz, take a look at this (SO) post to see ways to help remove redundant header files.

    Our C++ solution is of this rough size and used to take us 50 mins to compile, by careful header file analysis, we got that down to 8 mins.

    0 讨论(0)
  • 2021-01-11 15:42

    If 1300 files are taking THAT long to compile then you are including waaaay too many header files that are unncecessary. I'd guess people have cut and pasted a bunch of headre files into a CPP file without thinking which headers they actually need so that loads of them are getting included when they ought not to be. I'm also guessing that you aren't forward declaring classes where you should be.

    I'd suggest you need to spend some time going through your project and removing unnecessary #includes. I suspect this will fix your out of memory problems AND will improve your compile time.

    0 讨论(0)
  • 2021-01-11 15:43

    IncrediBuild (distributed build system for VC++) besides the time-saving has an additional helpful function. It will restart a compile automatically if the remote machine fails to return results. So you should be able to get full builds, without crashes in 5 or perhaps 10 minutes.

    0 讨论(0)
提交回复
热议问题