Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2004-05-25 11:32:10


Mike Feldmeier <pooky_bunny_at_[hidden]> wrote:
[ Ben Hutchings wrote:]
> > Mike Feldmeier <pooky_bunny_at_[hidden]> 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<void,class
> > > _STL::allocator<class boost::function_base> > const &)"
> > > (__imp_??0thread_at_boost@@QAE_at_ABV?$function0_at_XV?$allocator_at_Vfunction
> > > _base_at_boost@@@_STL@@@1@@Z) referenced in function "public: void
> > > __thiscall mytest::test::converter::run(void)"
> > > (?run_at_converter@test_at_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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net