Advertisement

Please Help

Started by December 01, 2001 10:06 PM
14 comments, last by Sair 23 years ago
This is a Newbie question im sure. I looked for post relating to this couldn''t find it, looked for about 2 hours all over help files and the Microsoft website and still couldn''t find anything. My Problem is these errors im getting when compiling some of the Examples on Andre Lamothe''s TOTWGPG Book using VC++ 6.0 and DirectX 7.0a. I continue to get: error LNK2001: unresolved external symbol _DirectDrawCreate@12 and others with other examples. I know what a LNK2001 error is but I couldn''t find anything to fix this. Please Help Me. Thanks Ahead, Sair
Hey there,

I''m using Andre''s Tricks of the window game... book too.
And I''m here for roughfly the same thang.
I think I might know your problem. I got something like that before I added the DDraw files to my project. Apparently adding them with #include is not enough. Make sure they are in your project.

hope that does it.
Advertisement
Add the DirectX library files'' path to your VC settings so your linker can find it:
Tools->Options->Directories->Libraries

Make sure you bump it up the list so it comes before the standard VC paths; VC comes with DX3, so the linker will try those first by default (which wont work).
hey Oluseyi,

you look like you know what your talking about. I havea similar problem. when I try to compile I get a Link error. It says that IID_IDDirectDraw4 is an undefined Symbol. Got any ideas?
Nope, didnt work for me. Thanks for trying though. Hope we get this solved soon, Ive been reading and taking notes on the book, and in my mind I understand a lot of it, but I want to know the extend of my study by creating my own DirectDraw apps.

Thanks,
Sair
First thing I did Oluseyi. =P
Advertisement
I know. Frustrating isn''t it? The problem is I don''t know what I don''t know. So I have no idea how to find out what the problem is. I''ve spent all day on some tiny little detail that I''m just not aware of. Well good luck to you.

fellow bafflee
YEAH!! Figured it out. Looks like you'd have to do this for every new project or whatever(dang).

-------------
Reason 2: The Library Files were not Added to the Project

If your error looks like this:

Prog8_3.obj : error LNK2001: unresolved external symbol _DirectDrawCreate@12

This indicates that implementation for a function couldn’t be found. In this case, the DirectDrawCreate function could not be used because the DirectDraw library file (ddraw.lib) was not added to the project. Similar errors can occur for DirectSound (dsound.lib) and DirectInput (dinput.lib).

To solve this problem in the Visual C++ editor:

Go to the Project menu
Select Settings… to bring up the Project Settings dialog.
Click on the Link tab.
In the Object/library modules field, scroll to the end and add the module name (make sure there is a space between this module and the previous module listed). For example, to add the DirectDraw library file, add "ddraw.lib" to the end.
Click the OK button and re-compile.
----------------

amazing what google.com can do to help =P. Also remember it must be a win32 application, not a win32 console application, If you just open a text editor like I do, set /subsystem:console to /subsystem:windows in the project setting -> Link tab: under Project Options.

Edited by - Sair on December 1, 2001 11:42:23 PM
quote: Original post by Galileao
...IID_IDDirectDraw4 is an undefined Symbol.

Missing GUID declaration. At the top of your file that includes &ltddraw.h>, you need to define INITGUID:
#define INITGUID#include <ddraw.h>...// everything else 

You also need to add dxguid.lib to your project.
It Worked!!!!!

Oluseyi is a freakin Genus. I''m not even upset that 20 seconds of adding stuff would have saved about 5 hours of time. I''m just so happy. I cried. Thank you. Thank you. I''m not sure what I just did, but now that I know what I didn''t do I can read up on it. Thanks a bunch.

This topic is closed to new replies.

Advertisement