Jump to content
  • Advertisement
Sign in to follow this  
Falcon213

Exe links library links library, linker error

This topic is 3844 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

So I wrote a library that links DX libraries (d3d9.lib and d3dx9.lib), and when compiled, gives no errors. However, when I compile the exe that links to my library, I get errors as if the exe was missing a reference to the DX libs (eg. unresolved external symbol _Direct3DCreate9@4). I have set the build order to build the library first, and set the exe to be dependant on the lib.

Share this post


Link to post
Share on other sites
Advertisement
d3d9.lib and d3dx9.lib won't be included into your library. Your exe still needs to specify both of them to be resolved.

Or you can add these two lines:
#pragma comment(lib, "d3d9")
#pragma comment(lib, "d3dx9")

into one of your main-game-lib.h file of your library, and make sure the library search path could reach the both .lib files.

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!