Scenario: when the regular module of the boost library is used, compilation is too slow. I read the header file.
[Cpp]
# Include <boost/regex. hpp>
It depends on a considerable number of header files, which should be the root cause.
Currently, it is known that only the pre-compiled header can be used in a computer with a low cpu. This problem occurs only after the code is modified. Www.2cto.com
--- It can save 20 seconds.
1. Pre-compiled header file generation. Similarly, if you use vc ++, you can use your own generation method.
G ++-o/E/software/Lib/common/boost-1.46.1/win32/release/share/include-gch/StdAfx. h. gch-x c ++-header-c src/StdAfx. cpp-g-Wall-IE:/software/Lib/common/boost-1.46.1/include
2. It can only be placed in the first line of the. cpp file. Note that it is not a. h file. Otherwise, an error will be prompted. Otherwise, the previous content will be ignored.
Include/data/schema_analyse.h: 11: 20: error: StdAfx. h: No such file or directory
There is a problem that has not been solved, although it has not been encountered.
3. but there is a problem not in the header file, that is, the header file contains the structure of the 3rd-party library. When the class member variable is used, the header file must contain the 3rd-party library, this slows down compilation. that is to say, if a pointer is used in the header file, variables of the reference type can be used to make good use of the pre-compiled header file. but what if it is inherited?