简体   繁体   中英

using the release version of boost libs in debug mode

I have a visual C++ project. I cannot use the release version of boost_filesystem-vc110-mt-1_54.lib in debug mode and it keeps asking for boost_filesystem-vc110-mt-gd-1_54.lib. I know that debug mode should use debug lib but I dont want to build and keep the debug version. I did try the Runtime Library Setting.

How to do this?

Short answer: You don't. Boost uses parts of the C++ runtime which work differently in Debug and Release so stuff is likely to break eventually.

However, if you absolutely want to shoot yourself in the foot: You can prevent automatic linking by setting the BOOST_ALL_NO_LIB preprocessor flag and then manually link to the release binary instead.

You really, really shouldn't use the release version of Boost in a debug build, because (as ComicSansMS said) it links against the release runtime library, and your debug build links against the debug runtime library.

If you really want the release version of Boost (in the case of Filesystem, I must stress that this is probably not useful), you will have to compile your own, which is optimized but links against the debug runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM