Precompiled headers with GCC

I have definitely had success. First, I used the following code: #include <boost/xpressive/xpressive.hpp> #include <iostream> using namespace std; using namespace boost::xpressive; // A simple regular expression test int main() { std::string hello(“Hello, World!”); sregex rex = sregex::compile( “(\\w+) (\\w+)!” ); smatch what; if( regex_match( hello, what, rex ) ) { std::cout << what[0] << ‘\n’; … Read more

GCC and Precompiled Headers

Current GCC (i.e. 4.7) and previous versions of it works nicely with precompiled headers only when you have a single common header to your application, and when that single header (which includes in turn all the system ones, and the library specific ones, required by the application) is #include-d (as the first non-comment lexeme of … Read more

Purpose of stdafx.h [duplicate]

stdafx.h is a file, generated by Microsoft Visual Studio IDE wizards, that describes both standard system and project specific include files that are used frequently but hardly ever change. Compatible compilers (for example, Visual C++ 6.0 and newer) will pre-compile this file to reduce overall compile times. Visual C++ will not compile anything before the … Read more