tags:

views:

239

answers:

2

Hello,

Visual Studio 2005

I am linking with boost libraries release 1_33_1.

I keep getting this link error.

libboost_thread-vc80-mt-sgd-1_33_1.lib(once.obj) :error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)

Does anyone have any suggestions?

Many thanks,

Edit ======

After recompiling the boost libraries using these switches:

C:\boost_1_42_0>bjam --build-dir=d:\boost_1_42 --build-type-complete --toolset=msvc-8.0 address-model=32 architecture=x86

I am getting some of the following errors:

1>msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>msvcrtd.lib(MSVCR80D.dll) : error LNK2005: __wassert already defined in LIBCMTD.lib(wassert.obj)

Anyone have any ideas?

Many thanks,

+1  A: 

First of all you don't have to set address-model and architecture explicitly if building 32 bit. Also your call has an error: --build-type-complete should be --build-type=complete. If I'm not wrong your call builds absolutely all libs, including filesystem, regex etc.
Obviously you need boost::thread only, so I would recommend to try this call:

C:\boost_1_42_0>bjam --build-dir=d:\boost_1_42 --build-type=complete --toolset=msvc-8.0 --with-thread

But I don't think that will solve your prob but you could give it a try.

My guess is that you somehow mixed /MD and /MT in the project settings.
See these links: First, second

Simon Linder
+1  A: 

What is probably happening is that your project is linking to the static debug version of the C++ runtime, which causes the static debug boost thread library to be linked and is also linking to another static library which was dynamically linked to the C++ runtime.


The sgd tag in libboost_thread-vc80-mt-sgd-1_33_1.lib means that the boost thread library you're linking with was built against the static debug version of the C++ runtime.

Joe Gauterin