Skip to main content
GameDev.net gamedev.net
🔒 Locked

autolinking libraries

Started by Nitage Aug 27, 2005 at 4:35 AM 1 replies 650+ views
Original Post
Nitage
Nitage
I'm trying to create a set of C++ libraries, but I want to be able to just include the header file without setting the project to link to the .lib file. This can be accomplished by including the line:

#pragma comment( lib, "lib_path" )
However, to be able to do this I need to be able to detect which version of the CRT the including program is linked to (release, debug , multithreaded etc), so I can link the appropriate version of my library. Does anybody know how to do this? P.S. I intend to wrap all this in an #if _MSC_VER, so that the library headers are still compatible with other compilers.
_the_phantom_
_the_phantom_
I got all my infomation on this from looking at the boost config.hpp files
SiCrane
SiCrane
Or you can just look at the MSVC help files for the /MD, /MDd, etc. switches. For example, /MD defines both _MT and _DLL, but /MDd defines _MT, _DLL and _DEBUG.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.