error LNK2001: unresolved external symbol _DirectDrawCreateEx@16

Started by
7 comments, last by latir 16 years, 8 months ago
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.
Advertisement
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.
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.
IIRC, there's a flag in the linker options, something like "include default libraries" -- try changing this. It worked for me when I had a similar issue with SDL.


poss.
If at first you don't succeed, call it version 1.0You don't stop playing because you get old; you get old when you stop playing.
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.
Could Some One Please Help Figure Out The Problem.
Can you post the source code?

BTW, you should stop using VC++ 6 and switch to VC++ 2005 Express, which is free and much better. Just make sure you follow these steps after installing it.
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.
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.

This topic is closed to new replies.

Advertisement