Troubleshooting C++ TR1 problem in Visual Studio 2008

Patrick Getzmann and I have been exchanging email about a problem he had using some sample code I’d written for working with regular expressions in C++. I wasn’t much help, but Patrick figured it out. I wanted to post his solution here in case someone else has the same problem.

His code would compile but not link. The compiler gave the error message “regex.obj : error LNK2019 …” His solution follows.

I have German Visual Studio installed. The Feature Pack is bundled with SP1 in the German Version. My Installation order was:

1. Visual Studio 2008
2. Visual Studio 2008 SP1 (including the Feature Pack)
3. Windows SDK for Windows Server 2008 and .NET Framework 3.5

But it should be (If one needs/wants the Server 2008 SDK):

1. Visual Studio 2008
2. Windows SDK for Windows Server 2008 and .NET Framework 3.5
3. Visual Studio 2008 SP1 (including the Feature Pack)

Otherwise reinstallation of SP1 helps.

The same problem would show up if you were using C++ TR1 random number generators. In a nutshell, try reinstalling SP1.

2 thoughts on “Troubleshooting C++ TR1 problem in Visual Studio 2008

  1. Actually, I wasn’t able to get my code to work with gcc. When I first tried it, gcc didn’t support TR1 regex. I tried again with a later version of the compiler after they added regex support but it didn’t get to work that time either. The problem may be my ignorance of Linux configuration rather than a problem with gcc.

Leave a Reply

Your email address will not be published.