Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem using Boost regex
From: John Maddock (john_at_[hidden])
Date: 2009-12-07 11:21:30

> [Addendum...] Following my original post, firstly, apologies - I should
> have
> mentioned that I'm trying to build the regex example using Visual Studio 8
> Express Edition (i.e. VC++2005). Also, I've got some more information....
> Apart from those libs that I mentioned in my original post, I've found a
> whole bunch of libs beginning with "libboost-regex-vc80-" and ending with
> these suffixes:-
> mt-1_40.lib
> mt-gd-1_40.lib
> mt-s-1_40.lib
> mt-sgd-1_40.lib
> s-1_40.lib
> I guess these must be the static link libs. Anyway, I've discovered that
> if
> I link to any lib that ends in "mt-1_40.lib" I can build my app and launch
> it successfully as long as I build in Release mode. But in Debug mode,
> the
> app either doesn't launch - or if it does launch, it gives the unhandled
> exception that I described earlier.

Here's the thing, with VC++ you absolutely must link to the library variant
that was built with the exactly the same runtime options as your code -
that's why there are so many VC++ binaries supplied. If you don't do that
then your code will crash.

Now for the good news: Boost.Regex will automatically select the correct
library variant to link against, you don't need to do anything, and you
shouldn't explicitly link against any of those libraries. Just make sure
that the directory containing the libraries is in your library search path
(under properties->linker->Additional Library Directories).

HTH, John.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at