Boost logo

Boost Users :

Subject: Re: [Boost-users] Serialization linker error: wstring and libcpmt.lib
From: David Ward (davidjward30_at_[hidden])
Date: 2010-12-20 04:28:06


Date: Mon, 20 Dec 2010 02:35:10 +0000
From: jjplawnewera_at_[hidden]
To: boost-users_at_[hidden]
Subject: [Boost-users] Serialization linker error: wstring and libcpmt.lib

Hi guys,

I have just started to use boost::serialization to serialize a complex data structure in a VS2005 MFC project.
I'm still very unfamiliar with boost but i need to get this done by then end of the day.
I ran into a couple of linker errors during compilation:

error
 LNK2005: "public: unsigned int __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::size(void)const "
(?size@?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QBEIXZ)
 already defined in msvcprt.lib(MSVCP80.dll) libcpmt.lib

---
Hi,
Your first error looks like your are trying to link both static (libcpmt.lib) and dynamic (msvcprt.lib) CRTs at the same time. This dependency could be hidden in a third party lib, including boost. Make sure that everything in the same module (dll, exe) links to the same version.
http://msdn.microsoft.com/en-us/library/abx4dbyh(v=VS.90).aspx
Adding /verbose link usually helps.
Regards,
David. 		 	   		  


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