I am building an application whose output is libraries that end up being used by another client application. I recently discovered I was building my application in debug mode using /MDd
for code generation (debug CRT libraries) and that the client application was built against release CRT even using /MD
in debug mode. Hence this can cause some memory heap corruption errors. To confirm, this I tested everything in release mode and there it appears to work fine.
To address the issue, I tried doing a release with debug info
build (/MD
) too and link the debug build of the client application against this relwithdebinfo
build, but now I am seeing some strange behavior in the client application when testing my example. To be precise, when I assign a string, say using:
std::string client_str = some_namespace_in_my_library::class_name::string_name,
I find that client_str is not assigned, rather remains empty. This was working fine when everything was built in debug (when mix and match was present). Any ideas why this is happening? The string in the namespace referenced above is a static public member of the class, class_name
. All this is on MS VC++ 2005. Any advice/help is appreciated very much. Thanks!