#### Archived

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

# Tricks of the Windows Game Programming Gurus

## Recommended Posts

I've got a prob and was hoping one of ya'll would help me out I created a new project, included the DirectX libs, includes, and headers, and I tried to compile the third program in Chapter 6 ... it didn't work. Here's the error it gave me: demo6_3.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw4 Debug/directx.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Do any of ya know how to fix this problem? [edited by - zer0wolf on April 30, 2003 1:42:26 AM]

##### Share on other sites
Did you create a win32 application or a win32 console application?

Win32 app

##### Share on other sites
In your include and lib directory settings, make sure that the DirectX SDK directories are at the top. VC++ comes with DirectX 3 headers and libs, so it''ll find those first and try to use them unless you put the SDK directories at the top of the list.

##### Share on other sites
they''re already at the top...

did u write
#define INITGUID
??

##### Share on other sites
Did you add the filenames to Project->Settings->Link?

##### Share on other sites
Star2-

no... I just lifted the code right off of the CD that came with the book, but I don't see that anywhere in the code.

[edited by - zer0wolf on April 30, 2003 2:38:55 AM]

##### Share on other sites
flukus-

the only DirectX lib it used is ddraw.lib, and I did add that one, at the beginning of the list

##### Share on other sites
Did u try to add it and see if it works?

EDIT: talking about the define (#define INITGUID)

[edited by - Star2 on April 30, 2003 2:43:29 AM]

##### Share on other sites
Star2-

I tried it, same error

##### Share on other sites
Thats strange, In my code the top is:

  // DEMO6_3.CPP basic full-screen pixel plotting DirectDraw demo// INCLUDES ///////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN  // just say no to MFC#define INITGUID // make sure directX guids are included#include <windows.h>   // include important windows stuff#include <windowsx.h>

didnt include the whole source, just the top part..
And if I remove the #define INITGUID
I get that error but with _IID_IDirectDraw7 (because it uses DirectDraw 7)
I got TOTWGPG Second Edition..

##### Share on other sites
I've got the first edition... the code isn't quite the same apparently...

awesome... adding that code plus adding dxguid.lib makes it work! That must have been a code error that he fixed between both of the books.

Thanks Star2!

[edited by - zer0wolf on April 30, 2003 2:55:28 AM]

##### Share on other sites
Glad u got it fixed..

Strange tho, I never needed to add dxguid.lib to the Link list.
Only ddraw.lib and it built without errors, even ran fine.

EDIT: I use Microsoft Visual C++ 6 Introductory Edition
that follows with the book.

[edited by - Star2 on April 30, 2003 2:57:40 AM]

##### Share on other sites
I''m using VIsual Studio 6.0 professional, and I''ve downloaded the service packs. oh well... I''m just glad it works now

##### Share on other sites
Remember when your reading that book that andre likes to explain things in order of hardest to easiest, almost like hes justifying the use of direct x. So read a whole chapter befor trying out any of the stuff.

##### Share on other sites
Srry to harase you but would C++ Compiler Plus be as good as Advance C++ if not what is the site for Advance C++.

##### Share on other sites
the_serp,

why do you keep posting the same questions in multiple topics?

##### Share on other sites
zer0wolf

Is it " Tricks ..." edition 1 ?
Are you using direct x 7.0 or 8.0 ?
I had the same error message " ...unresolved..."
Despite the COM technology some demos work with direct x 6.0 only.
I wrote to Andrè and he fixed the problem.
It was a long time ago so I do not remember the details

##### Share on other sites
AlbertoT -

Its the first edition of the book and I''m using DirectX 8.0

##### Share on other sites
Unfortunately, that is not the first code error / tutorial omission that LaMothe makes, from what I remember All in all though, it''s a great book, despite this.

• ### Forum Statistics

• Total Topics
628333
• Total Posts
2982139

• 9
• 24
• 9
• 9
• 13