Boost thread.hpp包含错误

时间:2017-04-19 15:27:46

标签: c++ multithreading boost

我能够在一个简单的示例项目中包含boost库而没有任何问题,并且它可以正常工作。但是,只要我将#include <boost/thread.hpp>包含在已经使用其他库的其他项目中,我就会遇到以下编译错误:

1>ClCompile:    
1>  ThreadManager.cpp    
1>C:\Boost\include\boost-1_63\boost/container/container_fwd.hpp(302): warning C4003: not enough actual parameters for macro 'dummy'     
1>C:\Boost\include\boost-1_63\boost/container/container_fwd.hpp(302): error C2976: 'atl::Dummy' : too few template arguments    
1>C:\program files\adaptive vision\adaptive vision studio 4.3 professional\sdk\include\ATL/Dummy.h(17) : see declaration of 'atl::Dummy'    
1>C:\Boost\include\boost-1_63\boost/container/container_fwd.hpp(302): error C3484: syntax error: expected '->' before the return type    
1>C:\Boost\include\boost-1_63\boost/container/container_fwd.hpp(302): error C2061: syntax error : identifier 'Get'    
1>C:\Boost\include\boost-1_63\boost/container/container_fwd.hpp(302): error C2334: unexpected token(s) preceding '{'; skipping apparent function body    
1>    
1>Build FAILED.

PS:如果我包含#include <boost/chrono.hpp>而不是#include <boost/thread.hpp>,那么就没有错误。

PSS:我正在使用Windows,Visual Studio 2010(这就是Boost的原因)

示例代码:

#include <string>
#include <vector>
#include <algorithm>

#include <stdlib.h>

//Header for boost multithreading
//#include <boost/chrono.hpp>
#include <boost/thread.hpp>

namespace avs //Adaptive Vision
{
    class MyProgram : public UserFilter
    {
        int Invoke()
        {
            //CODE
        }
    };

}

0 个答案:

没有答案