views:

92

answers:

1

Hello,

The title is just for teasing. :-) I know it isn't possible, but here is my problem.

My app (a DLL, actually) uses Boost. It also uses an external API, which also uses Boost. The external API is of course provided in a release binary, anlong the needed release Boost binaries.

When I compile/link my DLL in release mode, I have no problem. I precise I link my app to Boost in a dynamic way (BOOST_ALL_DYN_LINK). In debug mode, I can't load my DLL. I am not sure it is because of Boost, but I suspect Windows doesn't like working with two Boost (the release one called by the external lib, and the debug one called by my code).

Will it work better if I link my code statically with the release Boost ?

I don't think it is related to CRT, because I have nothing in the Events Viewer.

I use Visual Studio 2005 SP1.

Thanks.

A: 

Will it work better if I link my code statically with the release Boost ?

Yes, that's what I would expect - if you link statically, you get a boost 'copy' in your binary, and no boost DLL is ever loaded for your own boost needs .. the external library will happily link to its release dlls. However, this won't work if the external library actually uses boost in its public API called by your application! In this case, you won't be able to solve the problem. If you call any APIs expecting boost stuff, your boost build must match the boost of the API's implementation.

Alexander Gessler
I intended to statically link my debug app to the release Boost.Does your "however" still apply ?
Oodini
If you link your application with a release build of boost .. why not use the same boost DLL runtime as the external library? I see no need to link statically then.
Alexander Gessler
You're totally right. My mind was stuck to 2 Boost packs. :-)
Oodini
Fine :-) You should probably accept the answer then to mark the topic as solved.
Alexander Gessler
As soon as I'll succeed to build my DLL with SCons I am discovering...
Oodini