2017-10-14 4 views
0

J'ai reçu le programme d'installation Windows Boost 64 bits pour VC++ 2010 (boost_1_65_0-msvc-10.0-64.exe) de https://sourceforge.net/projects/boost/files/boost-binaries/1.65.0/.Can Boost 1.65.x peut-il être utilisé avec Visual C++ 2010?

Les paramètres Include et Library path du projet sont corrects.

Si vous essayez de l'utiliser dans un projet de console x64, plusieurs erreurs de construction se produisent - je n'utilise ici que la classe de threads. Ce sont les erreurs je reçois:

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 ========== 

Répondre

0

J'utilise le paquet NuGet boost-VC100, la version 1.65.1.0 sur Windows 7, x86 sans problème.

+0

Notez que le paquet nuget nécessite VS2010 sp1 – Teolazza