Archived

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

zer0wolf

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites