Linker error when using boost::wregex (MSVC)
Hi, I'm trying to use the regex library (from boost 1.33) with the MSVC.NET 2003 and I'm getting the following linker error when using the wide character version of the classes: libboost_regex-vc71-mt-1_33_1.lib(usinstances.obj) : error LNK2005: "public: static bool __cdecl std::char_traits<unsigned short>::eq(unsigned short const &,unsigned short const &)" (?eq@?$char_traits@G@std@@SA_NABG0@Z) already defined in msvcprt.lib(MSVCP71.dll) libboost_regex-vc71-mt-1_33_1.lib(usinstances.obj) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<unsigned short>::length(unsigned short const *)" (?length@?$char_traits@G@std@@SAIPBG@Z) already defined in msvcprt.lib(MSVCP71.dll) Declaring a single wregex object is enough to get the error. Everything works fine for regular regex objects (using regular std::strings.) Any ideas how to solve this problem? Thanks in advance. Saludos! Fernando. -------------------------------------------------------------------------------------------------------------------- Confidentiality Notice: The information in this email is confidential and may be privileged. It is intended solely for the addressee(s). If the reader of this message is not the intended recipient, any disclosure, copying, distribution, retention or action taken or omitted to be taken in reliance on it is prohibited. If you have received this communication in error, please notify us immediately by replying to the message or by telephoning either 905-624-1260 or 1-888-672-5471 and deleting it and any attachments from your computer system.
Fernando Cuenca wrote:
Hi,
I'm trying to use the regex library (from boost 1.33) with the MSVC.NET 2003 and I'm getting the following linker error when using the wide character version of the classes:
You'll find some discussion of the issue and possible workarounds here: http://sourceforge.net/tracker/index.php?func=detail&aid=1470041&group_id=7586&atid=107586 Either apply the suggested patch, or build your app with /Zc:wchar_t, or rebuild the regex lib without /Zc:wchar_t. HTH, John.
participants (2)
-
Fernando Cuenca
-
John Maddock