开发者

Using in the same time Boost in release and debug mode

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 lik开发者_运维问答e 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜