Sign in to follow this  
Erzengeldeslichtes

debug/release libs

Recommended Posts

In most of my applications, all I link to is "somelib.lib" (like "user32.lib") in both my release and debug mode. But now I created my own, and I have to use the lib compiled in release mode with the release mode exe, and the lib compiled in debug mode in the debug mode exe. If I use, say, the release mode lib in debug mode exe, it crashes. Sometimes. Usually having to do with an STL class. Why don't I have to do this with any of Microsoft's libs, and how do I make my lib work like that?

Share this post


Link to post
Share on other sites
Simple. Don't use the STL in your lib. STL code is different in debug and release - the actual class definitions are different, so the library files are not compatible.

A more realistic solution would involve setting up your main project to link with different versions of your libraries depending on the build mode. Your IDE can do this. It may also let you set up build dependencies, so that it always makes sure the libraries are up to date before compiling the main project.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this