problem with boost::thread libraries
Hi, I came across this problem in using the threads package. I used the following files: boost_thread-vc71-mt-gdp-1_31.lib boost_thread-vc71-mt-gdp-1_31.dll boost_thread-vc71-mt-p-1_31.lib boost_thread-vc71-mt-p-1_31.dll While trying out a simple example from the test folder: #include <boost/thread.hpp> #include <boost/thread/xtime.hpp> using namespace boost; ............ ............ ............ void HelloWorld() { } ............ ............ ............ // Test threads boost::thread thrd(&HelloWorld); thrd.join(); ............ ............ ............ The application gave the following link error: Abacus error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::thread::thread(class boost::function0<void,class _STL::allocator<class boost::function_base>
const &)" (__imp_??0thread@boost@@QAE@ABV?$function0@XV?$allocator@Vfunction_base@ boost@@@_STL@@@1@@Z) referenced in function "public: unsigned int __thiscall mok3::Abacus::Application::init(void)" (?init@Application@Abacus@mok3@@QAEIXZ)
The program works fine without any parameters to the constructor ( boost::thread thrd; ), but of course that's not useful. If it were a syntax error it should be at compile-time, but there is no problem during compilation. Also, if there is a patch for statically linking threads package, it would be appreciated if you could send it. I am compiling the libraries with the following settings: Boost_1_31_0> bjam -sTOOLS=vc7.1-stlport -sSTLPORT_PATH=... install Thanks, -Vino
Some hints: 1) You are using version 1.31. Why are you trying to compile the libaries yourself? There are prepacked ones available I think. 2) Is your main file a CPP file? (Ending: *.cpp) -- Linker error suggests to me it could be a C file. 3) Static linking isn't supported in 1.31. It is available in upcoming 1.32 version. Roland
participants (2)
-
Roland Schwarz
-
Vinodth Mohanam