Skip to main content
GameDev.net gamedev.net
🔒 Locked

Newb in DDRAW HELL

Started by spanish Apr 10, 2002 at 4:31 PM 7 replies 200+ views
Original Post
spanish
spanish
Ahoy there fellow programmers. Im using ToftWGPG. When I link my DX program it says: DXfirst.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw4 Debug/DXfirst.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Now, I have ddraw.lib in link path under project->settings, and I have included in my code. I think I have to add the DirectX header paths to my compilers (MSVC++) .H search directory, but I don''t know how. Pls fill me in. Thx, and have a nice day
spanish
spanish
cpp boy
cpp boy
first of all you have made a direct draw program whit directx4

and i dont think you use directx4 (well i hope) and the header file for direct draw are either ddraw.h or d3d8.h

ddraw.h is the header for directx 7 and under and d3d8 is for directx 8 soo hope i help you

Kevin
Kevin
granat
granat
DirectDraw4 is the version included with DirectX6.
-------------Ban KalvinB !
Blacksmith_Tony
Blacksmith_Tony
Also just before you include the header files you will need to define INITGUID. Something like:

#define INITGUID
#include <ddraw.h>

The INITGUID, will fix the the type of problem you have. As long as you are doing everything else right . Hope this helps (and that I am right for once) .
EbonySeraph
EbonySeraph
Here''s is another hint of a possible problem. I programmed a bit today and had a BIG head ache over this problem:

DO NOT #define INITGUID more than ONCE in a project. It will define functions more than once and you will get tons of link errors. To keep it simple, you''re better off linking dxguid and not #define unless you fully understand what''s going on when you #define INITGUID (even inside the dx headers).

-This is an answer to a possible future headache you might have if you try implementing two DirectX API''s in one project later down the road.

"Ogun''s Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.
"Ogun's Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.
Blacksmith_Tony
Blacksmith_Tony
Or you could of course do this to prevent INITGUID being defined more than once:

#ifndef INITGUID
#define INITGUID
#endif

Do this everywhere you want to define INITGUID and it will only define it once.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.