This topic is 4686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
I got all my infomation on this from looking at the boost config.hpp files

##### Share on other sites
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.

1. 1
Rutin
19
2. 2
3. 3
4. 4
5. 5
frob
12

• 15
• 13
• 9
• 12
• 10
• ### Forum Statistics

• Total Topics
631442
• Total Posts
3000105
×