Boost test vs2013 fatal error C1001
在Visual Studio 2013中使用boost的test模塊時(shí)會(huì)報(bào)致命錯(cuò)誤,如下圖所示:

輸出報(bào)錯(cuò)信息如下:
1>------ Build started: Project: Test, Configuration: Debug Win32 ------
1> main.cpp
1>d:\boost_1_70_0\boost\type_traits\common_type.hpp(47): fatal error C1001: An internal error has occurred in the compiler.
1> (compiler file 'msc1.cpp', line 1325)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

定位到報(bào)錯(cuò)文件是common_type.hpp:

可以看出是因?yàn)镃XX11的原因,因?yàn)?/span>VS2013不支持C++11,所以boost提供了一個(gè)宏定義來設(shè)置是否支持CXX11:
BOOST_NO_CXX11_TEMPLATE_ALIASES
在Project->Properties->C/C++->Preprocessor中設(shè)置即可:

為了方便大家在移動(dòng)端也能看到我的博文和討論交流,現(xiàn)已注冊(cè)微信公眾號(hào),歡迎大家掃描下方二維碼關(guān)注。
