Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RoyHsu2001

DirectDraw & Direct3D compiling error

This topic is 6108 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 tried to integrate DirectDraw and Direct3D together by the samples, FullScreenMode and Tut06_Mesh. The FullScreenMode was extracted for "included files", "variables", "initial function", "Draw function" and "close function" and attach to the Tut06_Mesh at suitable places; finally, the error seemed not from my code. Does any one could help me? Thanks! common files// ddutil.h ddutil.cpp dxutil.h dxutil.cpp Link library// d3dx8.lib d3d8.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib including files// #include <d3dx8.h> #include <mmsystem.h> #include <windows.h> #include <ddraw.h> #include "resource.h" #include "ddutil.h" compiling// Linking... ddutil.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16 ddutil.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7 Debug/Meshes.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You have to add ddraw.lib to the link libraries

Share this post


Link to post
Share on other sites
Hi! I just got Isometric Programming w/ DirectX and having a small problem compiling the Chapter 5 source. It says something like
"unresolved external symbol DirectDrawCreateEX() in module Iso5_1.obj".

I''m including the library in the project, and i''ve got it to work using the same project settings, for the source code in Tricks of the Windows Programming Gurus.

I''m a Borland user...using the DirectX 7 SDK which came w/ the compiler.

Also, would there be any difference if i changed DirectDrawCreateEX() to DirectDrawCreate()? This is the first time I''ve ever seen DirectDrawCreateEX()...and i know they''re similar...

Thanks in advance

Chris

Share this post


Link to post
Share on other sites
For my problem, i managed to work around it.
Instead of using DirectDrawCreateEX(), I had to use DirectDrawCreate().

Because of that, I had to change a few lines...

in the source, instead of:
hr=DirectDrawCreateEx(NULL,(void**)&lpdd, IID_IDirectDraw7, NULL);

I used:
hr=DirectDrawCreate(NULL, (LPDIRECTDRAW *)&lpdd, NULL);

and after the testing if DirectDrawCreate failed, I added:

if (FAILED(lpdd->QueryInterface(IID_IDirectDraw7, (void**)&lpdd)))
return false;

I did this based off of the way LaMothe created DirectDraw Interfaces in Tricks of the Windows Programming Gurus.

*Had to cast &lpdd to LPDIRECTDRAW* as lpdd is IDirectDraw7.

And void** is the same as (LPVOID *), which is what the parameter looks like in ddraw.h.

I still don''t know what is wrong with DirectDrawCreateEX()...if anyone figures out what my problem is, I would still like to use it...

Chris

Share this post


Link to post
Share on other sites

  • 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!