Boost Static Linking Woes

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. 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. Is there any way I can get around this? I would like my application to be multithreaded rather than multithreaded DLL to avoid the side-by-side configuration error when distributing my exe. Thanks, Brian.

On Tue, Nov 11, 2008 at 5:12 PM, Brian Dawn
Is there any way I can get around this? I would like my application to be multithreaded rather than multithreaded DLL to avoid the side-by-side configuration error when distributing my exe.
Your side-by-side error is probably due to the VC++ runtime not being installed, or your exe not having a manifest to load it. -- Cory Nelson

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

Brian Dawn wrote:
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.
That suggests a build problem somewhere: do you still have BOOST_ALL_DYN_LIB defined or something?
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.
Sounds like you're mixing different runtime library versions - your linker should have emitted warnings or errors about that, either way it's a really bad idea, and the very problem that auto-linking was intended to solve! HTH, John.

Maybe you try to run a debug version on the other computer? There is no redistributable debug runtime for vc, so every attempt to start a program compiled with debug results in such message. Sönke -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Brian Dawn Sent: Wednesday, November 12, 2008 2:12 AM To: boost-users@lists.boost.org Subject: [Boost-users] Boost Static Linking Woes 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. 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. Is there any way I can get around this? I would like my application to be multithreaded rather than multithreaded DLL to avoid the side-by-side configuration error when distributing my exe. Thanks, Brian.
participants (5)
-
Brian Dawn
-
Cory Nelson
-
John Maddock
-
Schau,Sönke HG-Dir ae-se
-
Vladimir Prus