Recently, I used the Boost library for multi-thread development. It is visible that the compilation engineers in vs always encounter Macro redefinition errors, 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 redefinition1> c:\vc\include\boost\cstdint.hpp(376) : see previous definition of 'INT8_C'
At the beginning, I was not responsible for it. It was obvious that this was a slow Compilation speed, so I couldn't bear it. I decided to google it. I found someone in boost had submitted the bug and the status was fixed, refer to the following link
Ticket #4182
The following reply says that the macro "BOOST_HAS_STDINT_H" needs to be defined in the config file to solve the problem. However, I have not worked in this experiment for a long time, and then I want to fix Changeset 62082, the file below is modified.
boost/config/compiler/visualc.hpp
Then I checked my own file and found that it was fixed. But why is there an error? So I tried to comment it out.
# define BOOST_HAS_STDINT_H
Then re-compile and solve the problem,
So the final solution is:
Modify the vc compiler configuration file "boost/config/compiler/visualc. hpp" and comment out the macro definition "BOOST_HAS_STDINT_H" to solve the problem.
#if _MSC_VER >= 1600//# define BOOST_HAS_STDINT_H#endif
Or you can completely comment out the rows.
The principle of such modification is speculative: it should be that Microsoft's vc compiler files have also handled this problem, resulting in both parties simultaneously modifying the macro definition, resulting in the same macro definition is still not modified, the file is repeatedly included.
This work is licensed using the knowledge sharing signature-non-commercial use-share the 4.0 international license agreement in the same way.