- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all
If I try to use
Strangely, this works when using the Microsoft compiler. Anybody got an idea how to resolve this issue?
Michael
PS: This is with
If I try to use
std::tr1::regex
in more than one compilation unit I get a linker error because the static member data std::tr1::_Regex_traits::_Names
gets instantiated in each of the object files since the definition of the explicit specialization is in the
header.Strangely, this works when using the Microsoft compiler. Anybody got an idea how to resolve this issue?
Michael
PS: This is with
- Windows 7
- Visual Studio 2008 SP1
- Intel C++ Compiler 11.1.046
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A simple example would be the following:
main.cpp:
foo.cpp:
main.cpp:
[cpp]#include// This function is defined in foo.cpp and also // uses std::tr1::regex void foo(); int main(int argc, char* argv[]) { std::tr1::regex re("^Hello World!$", std::tr1::regex::extended); std::tr1::regex_match("Hello World!", re); foo(); return 0; }[/cpp]
foo.cpp:
[cpp]#includevoid foo() { std::tr1::regex re("African"); bool match = std::tr1::regex_search("European or African?", re); }[/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeh, I saw the issue too.
Thanks for reporting it and the testcase. I'll report it to the compiler engineering team. if there's any news, I'll let you know. At this moment, I don't know of any work-around.
Thanks again.
Jennifer
Thanks for reporting it and the testcase. I'll report it to the compiler engineering team. if there's any news, I'll let you know. At this moment, I don't know of any work-around.
Thanks again.
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
As a work-around (more like a cludge) I resorted to
Michael
As a work-around (more like a cludge) I resorted to
#include
all the files that use
into one single master-file instead of compiling them directly.Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
this issue has been fixed in our 12.0 compiler. the initial release should contain the fix.
thanks,
Jennifer

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page