Jump to content
  • Advertisement
Sign in to follow this  
Nitage

autolinking libraries

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!