RE: [Boost-users] boost::thread, boost::bind, and member functions
From: "Ben Hutchings"
Reply-To: boost-users@lists.boost.org To: Subject: RE: [Boost-users] boost::thread, boost::bind, and member functions Date: Tue, 25 May 2004 17:32:10 +0100 Mike Feldmeier
wrote: [ Ben Hutchings wrote:] 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.
Unfortunately, this whole roadtrip started with the need for STL collections to cross DLL boundaries, which is why I am using STLPort. The STL that comes with VC++ 7.1 doesn't (with the exception of string and vector). When I built boost, I built it with the vc7.1-stlport toolset, and I have the stlport library directory in my "additional library path". Along this line, I wonder if I need to be doing something special with the STLPort DLL?
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_________________________________________________________________ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
Unfortunately, this whole roadtrip started with the need for STL collections to cross DLL boundaries, which is why I am using STLPort. The STL that comes with VC++ 7.1 doesn't (with the exception of string and vector). When I built boost, I built it with the vc7.1-stlport toolset, and I have the stlport library directory in my "additional library path". Along this line, I wonder if I need to be doing something special with the STLPort DLL?
One thing to check, if you have the Platform SDK installed, you should have a 'depends.exe' application... this shows you the dll an exe or dll depends upon, and even which functions of those dlls are used. Make sure stlport is one of 'em. If it isn't, make sure that your additional directories (include and library) are **before** the VS and PSDK directories. Note that boost will still depend upon msvcpt71.dll and msvcr71.dll (when compiled with VS.Net2003, but it will use the stlport dll for stl objects.
participants (2)
-
GoochRules!
-
Mike Feldmeier