0
我從https://sourceforge.net/projects/boost/files/boost-binaries/1.65.0/獲得了用於VC++ 2010(boost_1_65_0-msvc-10.0-64.exe)的Boost 64位Windows安裝程序。Can Boost 1.65.x可以用於Visual C++ 2010嗎?
項目中的包含和庫路徑設置是正確的。
試圖在x64控制檯項目中使用它會導致幾個生成錯誤 - 我只在這裏使用線程類。這些都是錯誤的,我得到:
1>------ Build started: Project: CPSS, Configuration: Debug x64 ------
1> stdafx.cpp
1> SockServer.cpp
1> Linking to lib file: libboost_thread-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_date_time-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_system-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/system/error_code.hpp(255): warning C4355: 'this' : used in base member initializer list
1> Linking to lib file: libboost_chrono-vc100-mt-gd-1_65.lib
1> CPSS.cpp
1> Linking to lib file: libboost_thread-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_date_time-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_system-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/system/error_code.hpp(255): warning C4355: 'this' : used in base member initializer list
1> Linking to lib file: libboost_chrono-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/thread/detail/thread.hpp(271): error C2752: 'boost::move_detail::remove_reference<T>' : more than one partial specialization matches the template argument list
1> with
1> [
1> T=int (__cdecl &)(void)
1> ]
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/detail/meta_utils.hpp(105): could be 'boost::move_detail::remove_reference<T&&>'
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/detail/meta_utils.hpp(97): or 'boost::move_detail::remove_reference<T&>'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared(13) : see reference to function template instantiation 'boost::thread::thread<int(__cdecl &)(void)>(F)' being compiled
1> with
1> [
1> F=int (__cdecl &)(void)
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared(35) : see reference to function template instantiation 'std::tr1::_Ref_count_obj<_Ty>::_Ref_count_obj<int(__cdecl &)(void)>(_Arg0)' being compiled
1> with
1> [
1> _Ty=thread_t,
1> _Arg0=int (__cdecl &)(void)
1> ]
1> CPSS.cpp(34) : see reference to function template instantiation 'std::tr1::shared_ptr<_Ty> std::tr1::make_shared<thread_t,int(__cdecl &)(void)>(_Arg0)' being compiled
1> with
1> [
1> _Ty=thread_t,
1> _Arg0=int (__cdecl &)(void)
1> ]
1>E:\hld\Src\Boost\boost_1_65_0\boost/thread/detail/thread.hpp(271): error C2668: 'boost::forward' : ambiguous call to overloaded function
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/utility_core.hpp(252): could be 'T boost::forward<F>(int (__cdecl &)(void))'
1> with
1> [
1> T=int (__cdecl &)(void),
1> F=int (__cdecl &)(void)
1> ]
1> E:\hld\Src\Boost\boost_1_65_0\boost/move/utility_core.hpp(248): or 'T boost::forward<F>(int (__cdecl &)(void))'
1> with
1> [
1> T=int (__cdecl &)(void),
1> F=int (__cdecl &)(void)
1> ]
1> while trying to match the argument list '(int (__cdecl &)(void))'
1> SockServerEx.cpp
1> Linking to lib file: libboost_thread-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_date_time-vc100-mt-gd-1_65.lib
1> Linking to lib file: libboost_system-vc100-mt-gd-1_65.lib
1>E:\hld\Src\Boost\boost_1_65_0\boost/system/error_code.hpp(255): warning C4355: 'this' : used in base member initializer list
1> Linking to lib file: libboost_chrono-vc100-mt-gd-1_65.lib
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
請注意nuget包需要VS2010 sp1 – Teolazza