Hello i am building a game. The bigger it gets , the longer it takes to compile. I wanted to speed up compile time. I have a lot of headers and cpp's and they recompiled every time. I was thinking about when building my game, excluding some parts of it from the compile, so i can focus on one component at a time, instead of watching the whole game recompile every time. If files are present in my ms visual studio's project, is there a way to exclude some from the compile temporarily? thanks

Recommended Answers

All 4 Replies

The compiler will compile only relavant portion of the code. If you change Y and X depends on Y, then Y and X will get compiled and all files that depends on X will get compiled. If you want to reduce your compile time, you may want to take a look at http://c2.com/cgi/wiki?PimplIdiom and other search results.

Hello i am building a game. The bigger it gets , the longer it takes to compile. I wanted to speed up compile time. I have a lot of headers and cpp's and they recompiled every time. I was thinking about when building my game, excluding some parts of it from the compile, so i can focus on one component at a time, instead of watching the whole game recompile every time. If files are present in my ms visual studio's project, is there a way to exclude some from the compile temporarily? thanks

I don't know if Visual Studio supports this, but I suggest you use a Makefile to build your project. Basically, you tell the Makefile which code depends on what, and it'll figure out which code has changed and only recompile the code that changed.

Makefiles can get big (mine has about 200 for a medium sized project with 6000 lines of code), but it's worth it.

thanks people

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.