갑자기 두 프로젝트 솔루션이 컴파일되지 못했습니다. 빌드를 손상시킬 수있는 변경 작업은 기억이 없습니다. 한 프로젝트는 lib이고 다른 프로젝트는 exe입니다. lib 여전히 문제없이 컴파일하는 있지만 exe 실패합니다. 일부 부스트 파일이로드 될 때 문제를 격리했습니다. 여기에 오류 표시에 충분하다 a를 stdafx.cpp입니다 :VC++ 2008 부스트 문제 컴파일
#include "stdafx.h"
#include <boost/thread.hpp>
는 그리고이보고 오류입니다 :
1>Compiling...
1>stdafx.cpp
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdlib.h(525) : see declaration of '_ultoa'
1>c:\libs\boost_1_44_0\boost\mpl\size_t_fwd.hpp(23) : error C2143: syntax error : missing ',' before 'constant'
1>c:\libs\boost_1_44_0\boost\mpl\aux_\integral_wrapper.hpp(42) : error C2143: syntax error : missing ',' before 'constant'
1>c:\libs\boost_1_44_0\boost\mpl\aux_\integral_wrapper.hpp(84) : error C2143: syntax error : missing ',' before 'constant'
1>c:\libs\boost_1_44_0\boost\mpl\aux_\integral_wrapper.hpp(84) : error C3211: 'boost::mpl::size_t<__formal>::value' : explicit specialization is using partial specialization syntax, use template <> instead
1> with
1> [
1> __formal=1135
1> ]
1> c:\libs\boost_1_44_0\boost\mpl\aux_\integral_wrapper.hpp(45) : see declaration of 'boost::mpl::size_t<__formal>::value'
1> with
1> [
1> __formal=1135
1> ]
내가 눈치가 나는에 포함 라인을 변경하는 경우 :
#include <boost/bind.hpp>
#include <boost/function.hpp>
:
#include "stdafx.h"
#include <boost/thread/thread.hpp>
으로 코드에 포함이 작동하지만, 나는 다른이
또한 동일한 4 개의 오류 라인을 제공합니다.
누구든지 무엇이 잘못 될 수 있는지 알 수 있습니까? 나는이 코드가 몇 달 동안 작동했음을 다시 한번 말하고 있으며 오류는 어제 나왔다.
'stdafx.h'는 부스트 헤더를 포함 할 수있는 적절한 위치입니다. 공통적 인 규칙은 거의 수정되지 않은 모든 헤더를 미리 컴파일 된 헤더에 포함시키는 것입니다. 먼저 winapi 항목을 포함하고 STL을 누른 다음 boost를 누른 다음 다른 항목을 포함시킵니다. 이 문제의 탐지를 간소화 할 수 있습니다 –