Sign in to follow this  

VS 2005 linking error

This topic is 4225 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 hate stupid things like this. I have upgraded to Visual Studio .NET 2005 from VS 2003 .NET. It used to compile fine. Now I'm getting the following linking error:
Error 21 error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function "bool __cdecl Graphics::InitDirectDraw(struct HWND__ *)" (?InitDirectDraw@Graphics@@YA_NPAUHWND__@@@Z) BlackJack.obj
I made sure all the directory info was the same in VS2005 but still no luck. Anybody have any idea why this is happening? I really wanted to get back to work on this project but my IDE isn't letting me. Thanks

Share this post


Link to post
Share on other sites
Did you link with the DirectDraw libraries? You must include ddraw.lib and dxguid.lib to your project, either from the project settings or by adding these lines to a header file:
#pragma comment(lib, "ddraw.lib");
#pragma comment(lib, "dxguid.lib");

Hope this helps.


EDIT: beat-me-up

Share this post


Link to post
Share on other sites
I actually had the #pragma lines already but still no luck. After looking at the error more carefully, I am noticing that it is choking on "struct HWND". Could it be another library that it's looking for?

Share this post


Link to post
Share on other sites

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