4 link errors related to boost_thread_vc100_mt-1_47 libraries

Hi Boost users, I built boost_thread_vc100_mt-1_47.lib and boost_thread_vc100_mt-1_47.dll successfully by using 1_47 source codes without changing any thing. When I used the libraries in my project, I got the following link errors: 1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl boost::thread::sleep(class boost::posix_time::ptime const &)" (__imp_?sleep@thread@boost@@SAXABVptime@posix_time@2@@Z) 1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static class boost::intrusive_ptr<struct boost::detail::thread_data_base> __cdecl boost::thread::make_thread_info(void (__cdecl*)(void))" (__imp_?make_thread_info@thread@boost@@CA?AV?$intrusive_ptr@Uthread_data_base@detail@boost@@@2@P6AXXZ@Z) 1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl boost::detail::free_raw_heap_memory(void *)" (__imp_?free_raw_heap_memory@detail@boost@@YAXPAX@Z) 1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void * __cdecl boost::detail::allocate_raw_heap_memory(unsigned int)" (__imp_?allocate_raw_heap_memory@detail@boost@@YAPAXI@Z) Can somebody kindly help me figure out a solution to fix them? Thank you Yan My working environment: Windows 7 + Visual Studio VC++10.

I built boost_thread_vc100_mt-1_47.lib and boost_thread_vc100_mt-1_47.dll successfully by using 1_47 source codes without changing any thing.
When I used the libraries in my project, I got the following link errors:
1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl boost::thread::sleep(class boost::posix_time::ptime const &)" (__imp_?sleep@thread@boost@@SAXABVptime@posix_time@2@@Z) 1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static class boost::intrusive_ptr<struct boost::detail::thread_data_base> __cdecl boost::thread::make_thread_info(void (__cdecl*)(void))" (__imp_?make_thread_info@thread@boost@@CA?AV?$intrusive_ptr@Uthread_data_base@detail@boost@@@2@P6AXXZ@Z) 1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl boost::detail::free_raw_heap_memory(void *)" (__imp_?free_raw_heap_memory@detail@boost@@YAXPAX@Z) 1>boost_UT.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void * __cdecl boost::detail::allocate_raw_heap_memory(unsigned int)" (__imp_?allocate_raw_heap_memory@detail@boost@@YAPAXI@Z) <...> My working environment: Windows 7 + Visual Studio VC++10.
Are you sure that the linker finds Boost.Thread library? I.e. do you add its path to the linker paths?

Hi Boost users, Can I put all #define like the following in boost/config/user.cpp instead of putting them in boostcpp.jam or/and other jam files? ... #define BOOST_NO_ANSI_APIS //( for example ) #define MY_VAR ... Thanks, Yan

Can I put all #define like the following in boost/config/user.cpp instead of putting them in boostcpp.jam or/and other jam files?
... #define BOOST_NO_ANSI_APIS
//( for example ) #define MY_VAR
Sure, you can put anything you like in there, and any Boost lib that uses Boost.Config will see it. HTH, John.

Hi Boost Users, When I compiled and linked my projects with Boost libraries, I got the following warnings ... 1>..\Boost\thread.cpp(186): warning C4273: 'boost::thread::thread' : inconsistent dll linkage 1>..\Boost\thread.cpp(189): warning C4273: 'boost::thread::start_thread' : inconsistent dll linkage 1>..\Boost\thread.cpp(247): warning C4273: 'boost::thread::get_id' : inconsistent dll linkage ... What could be the cause? I want to link Boost.thread dll dynamically and other Boost libraries statically. If I set #define BOOST_ALL_DYN_LINK, I could not generate boost_thread_vc100_mt-1_47.lib and boost_thread_vc100_mt-1_47.dll, so I commented out it to build boost_thread_vc100_mt-1_47.lib and boost_thread_vc100_mt-1_47.dll. In order to build all other static libraries, I set #define BOOST_ALL_DYN_LINK. So my libraries are mixed. Is it the cause for those warnings? How can I figure out a good solution to build some dynamic dll and other static libs at the same time? Thanks, Yan

Hi Boost Users, How can I build some boost libraries as dynamic dlls and other boost libraries as static libs at the same time? Thanks, Yan
participants (3)
-
code
-
Igor R
-
John Maddock