Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Include Libraries at source level

This topic is 5544 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 already use #pragma comment( lib,"opengl32.lib" ) to include OpenGL lib under MSVC. But now I want to be able to use such syntax to include my own libs :
    
// C:\AllMyLibs\mylib\mylib.h




// Adding 'C:\AllMyLibs' to lib directories

#if defined( _DEBUG )
#  pragma comment( lib, "mylib\\Debug\\mylib.lib" )
#else
#  pragma comment( lib, "mylib\\Release\\mylib.lib" )
#endif
// Linker error : can't find 'mylib\Debug\mylib.lib'


// Adding 'C:\AllMyLibs\mylib\Debug'

#pragma comment( lib, "mylib.lib" )
// Works


// (...)

    
Am I doing something wrong ? Thanks [edited by - cnstrnd on March 17, 2003 10:10:53 AM]

Share this post


Link to post
Share on other sites
Advertisement
Isn''t the current directory already "mylib"? If so, then you would just use

#pragma comment( lib, "Debug\\mylib.lib" )

or an absolute path might work:

#pragma comment( lib, "C:\\AllMyLibs\\mylib\\Debug\\mylib.lib" )

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!