Sign in to follow this  

Exe links library links library, linker error

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

This topic is 3629 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this