Sign in to follow this  

error LNK2001: unresolved external symbol _DirectDrawCreateEx@16

This topic is 3775 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 have a problem in my code. It may have already been covered before but i can't seem to find any answers. In my code i keep getting an unresolved error. -------------------------------------------------------------------------------- main.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16 Debug/DirectDraw Demo No 2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. DirectDraw Demo No 2.exe - 2 error(s), 0 warning(s) -------------------------------------------------------------------------------- I will privde the code if required and i have already included ddraw.lib and dxguid.lib in my project.

Share this post


Link to post
Share on other sites
When you get these kinds of errors and you can see that it refers to a library function (unresolved external symbol _DirectDrawCreateEx@16), go to the documentation, and take a look at the library requirements section:
Quote:
Import Library: Use ddraw.lib


So you need to add ddraw.lib to your linker dependencies. In VS2005, this can be found in Projects->Properties->Configuration Properties->Linker->Input->Additional Dependencies.


jfl.

Share this post


Link to post
Share on other sites
I Have Already Done That And I Stil Recieve The Error.

I Am Using Microsoft Visual C++ 6.0.

I Have Linked The Following Libraries:

--------------------------------------------------------------------------------
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ddraw.lib dxguid.lib
--------------------------------------------------------------------------------
Latir.

Share this post


Link to post
Share on other sites
I Can't Find The Flag.

If You Mean "Ignore All Default Libraries" I Have Tried It And It Only Brings More Errors.

Thanks For Suggestion.

Latir.

Share this post


Link to post
Share on other sites
Quote:
Original post by latir
I Have Already Done That And I Stil Recieve The Error.

I Am Using Microsoft Visual C++ 6.0.

I Have Linked The Following Libraries:

--------------------------------------------------------------------------------
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ddraw.lib dxguid.lib
--------------------------------------------------------------------------------
Latir.
You Don't Need To Start Every Word With A Capital Letter [smile]

First, don't use VC 6.0 unless you have no choice. It's broken in many, many ways and is NOT a C++ compiler. It came out before the first C++ standard. The ONLY reason you should be using it is if you have libraries or code that only works with VC 6 (E.g. some embedded system libs).
Do yourself a favour and get VC2005, which is a lot more standards compliant, generates faster code, very rarely gets internal compiler errors, and doesn't generate invalid assembly code (Which VC6 has been known to do, which is not only a debugging nightmare, but is also a security hole...)

Another point; you really shouldn't be using DirectDraw these days, you don't get any hardware acceleration at all, and it's often slower than using D3D to do 2D work.

As for the actual question, check that ddraw.lib is somewhere that Visual Studio can find, and that it's valid (E.g. not a renamed version of some other .lib).
Try putting the lib file in the same directory as your workspace file, that'll make sure VC can find it.
You could also try reinstalling the SDK.

Share this post


Link to post
Share on other sites
ok i have stopped using capitals.

I am gonna switch back to VC++ 2005 and try using it again.
As for the code think the error is gone now.

thanks everyone for your replies.

Share this post


Link to post
Share on other sites

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