Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Static Linking Woes
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-11-12 00:54:56

Brian Dawn wrote:

> Hello everyone!
> I current have the latest boost compiled with bjam, I have a complete build. I am also using MS
> Visual C++ 2008 express. So far everything works out perfectly, however when the compiled
> application was run on another computer I got a classic "This application has failed to start
> because its side-by-side configuration is incorrect." error. So instead of generating a
> multithreaded DLL I changed it to just multithreaded.
> However I then got this error message "Mixing a dll boost library with a static runtime is a
> really bad idea...". So it seems autolink wasn't finding my libraries.

If the error message say:

        "Mixing a dll boost library with a static runtime is a really bad idea..."

then your conclusion that autolink is not finding your libraries appears to be not based on
anything. Did you read, and understood the error?

> In order to get around this
> I then disabled the boost autolink feature and linked to the static libraries manually. The
> application was then able to compile correctly but I then received a runtime error complaining
> about a corrupt heap, my code ran just fine before.

This seems exactly what the error message what trying to prevent ;-)

> Is there any way I can get around this? I would like my application to be multithreaded rather
> than multithreaded DLL

I don't know how 'application' can be a 'DLL' at the same time. If you want your application to
be fully static, you need to use static Boost libraries -- and make sure that neither
BOOST_ALL_DYN_LINK, or BOOST_<library>_DYN_LINK macros are not set. I assume your application
explicit links to libboost_whatever.lib libraries, not boost_whatever.lib?

- Volodya

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