Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2006-04-13 15:38:42


Bugs item #1470041, was opened at 2006-04-13 12:38
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1470041&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: regex
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: John Maddock (johnmaddock)
Summary: regex linking error with VC 7.1

Initial Comment:
I see this error when linking against
libboost_regex-vc71-mt-1_33_1.lib:
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public:
static unsigned int __cdecl std::char_traits<unsigned
short>::length(unsigned short const *)"
(?length@?$char_traits_at_G@std@@SAIPBG_at_Z) already defined
in libboost_regex-vc71-mt-1_33_1.lib(usinstances.obj)

libs/regex/src/usinstances.cpp appears to have problems.

Steps to reproduce:
- Create a console project with VC7.1.
- Set Character Set to "Use Unicode Character Set"
- Use a Multi-threaded DLL
- Link against libboost_regex-vc71-mt-1_33_1.lib
- wchar_t should NOT be set as a native type
- Use the following code:

#include "stdafx.h"
#include <string>
#include <boost/regex.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
#if _UNICODE
        std::wstring strCurLine(L"sdfsdfggg");
        std::wstring strMatchExp(L"lsdfkjsflk");
        boost::wcmatch Matched;
        boost::wregex regex(strMatchExp.c_str());
#else
        std::string strCurLine("sdfsdfggg");
        std::string strMatchExp("lsdfkjsflk");
        boost::cmatch Matched;
        boost::regex regex(strMatchExp.c_str());
#endif
        boost::regex_search(strCurLine.c_str(), Matched, regex);

        return 0;
}

There are no linking errors if you build with wchar_t
as a native type or build with character set as "Use
Mutli-Byte Character Set".

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1470041&group_id=7586

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk