The recent use of boost library for multithreaded development, visual in VS compiler engineers always encounter macro redefinition error, similar to the following error description
1>c:\program files (x86) \microsoft Visual Studio 10.0\vc\include\stdint.h (116): Warning C4005: ' int8_c ': Macro Redefi Nition
1> c:\vc\include\boost\cstdint.hpp (376): Previous definition of ' int8_c '
At first no tube, visible later this thing is really slow to compile speed, so can not endure, decisive Google, found that boost official has been submitted to the bug and the state is already repaired, refer to the link below
Ticket #4182
The following reply says that it is necessary to define "Boost_has_stdint_h" in config file to solve the problem, but I experimented for half a day without any effect, and then look at the repair changeset 62082, found that the modified is the following file
Boost/config/compiler/visualc.hpp
Then I checked the file I used and found it was fixed, but why was it wrong, so I tried to comment out
# define Boost_has_stdint_h
And then recompile, and found that the problem was solved,
So the Final solution is:
Modify VC compiler configuration File "Boost/config/compiler/visualc.hpp", comment out "BOOST_HAS_STDINT_H" macro definition, can solve the problem
#if _msc_ver >= 1600
//# define Boost_has_stdint_h
#endif
Or you can just comment out these lines completely.
This modification of the principle of speculation: it should be Microsoft's VC compiler related files also handled the problem, resulting in both sides to modify the macro definition, resulting in the equivalent of the macro definition is still not modified, the file contains duplicate.
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/cplus/
Author: cnblogs Angry Frog