RE: [Boost-users] boost::thread, boost::bind, and member functions
Mike Feldmeier
Mike Feldmeier
wrote: <snip> This consistently produces the linking error:
converter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall boost::thread::thread( class boost::function0
const &)" (__imp_??0thread@boost@@QAE@ABV?$function0@XV?$allocator@Vfunction _base@boost@@@_STL@@@1@@Z) referenced in function "public: void __thiscall mytest::test::converter::run(void)" (?run@converter@test@mytest@@QAEXXZ) I think you aren't linking with the thread library. <snip> I'm using Visual C++ 7.1, but using straight C++, no .NET. I've defined the addtional library path (C:\boost\lib) and tried linking (in the additional dependencies) with boost_thread-vc71-mt-gdp-1_31.lib, boost_thread-vc71-mt-gdp.lib, boost_thread-vc71-mt-p-1_31.lib, and boost_thread-vc71-mt-p.lib (one at a time, of course), but I get the same error message with all of them. <snip>
I've worked it out now. In your main program you are using STLport - notice the "_STL" namespace instead of "std" but Boost.Thread is built with the library that comes with VC++ 7.1, which of course uses the "std" namespace. Unless STLport has some specific feature that you need I suggest you use the standard library that comes with VC++ 7.1; it's a very good implementation. If you must use STLport then you need to build Boost.Thread (and any other libraries with which you share standard library types) using it.
participants (1)
-
Ben Hutchings