3 ms·
- For simple 'syntax checking' compiles, compile only the module ('.cpp file') you're working in. This requires a proper IDE or at least some editor support - f
by roel_v 15y ago
- For simple 'syntax checking' compiles, compile only the module ('.cpp file') you're working in. This requires a proper IDE or at least some editor support - for VS it's ctrl-f7.
- For 'whole-project' compiles, limit the amount of them to the absolute minimum. Use unit tests to test fundamental functionality rather than running the whole program.
- Use a compiler that supports precompiled headers, understand how it works and use it as it's designed.
- Pay attention to your #include graph. Only include headers where they're used (i.e., in the .cpp file and not in the header where it's possible), use Cheshire cat where possible, and put as much into the precompiled header as possible.
Doing all of these things make C++ compilation bearable, but still it's a nice change when I write code in C# or 'scripting' languages and compilation times disappears. It's one of the more annoying aspects of C++, but despite it and a bunch of other nitpicks, it's still my favorite language.