Problem with Windows Game Programming Gurus example

Started by
4 comments, last by mojomonkey 22 years, 9 months ago
Hello, I have been struggling with this for too long now. I am trying to compile the first example in Andre LaMothe''s Tricks of the Windows Game Programming Gurus book ( the FreakOut game ). I am using MS Visual C++ 6 and create a new Win32 app project. I add the following files to the project: blackbox.cpp, blackbox.h, freakout.cpp, and ddraw.lib. When I compile I get the following compilation errors: -------------------------------------------------------------- Compiling... blackbox.cpp d:\source\t3dchap01\blackbox.h(34) : error C2146: syntax error : missing '';'' before identifier ''lpdd'' d:\source\t3dchap01\blackbox.h(34) : fatal error C1004: unexpected end of file found freakout.cpp d:\source\t3dchap01\blackbox.h(34) : error C2146: syntax error : missing '';'' before identifier ''lpdd'' d:\source\t3dchap01\blackbox.h(34) : fatal error C1004: unexpected end of file found Error executing cl.exe. FreakOut.exe - 4 error(s), 0 warning(s) --------------------------------------------------------------- I''m very confused as to why this is occuring. Any help would be greatly appreciated, if needed, I can e-mail you the source code. Thanks in advance for any help.
Advertisement
I guess I should provide a snippet of the code in question, at least where the compiler is complaining...

---------------------------------------------
// EXTERNALS //////////////////////////////////////////////////

...
extern LPDIRECTDRAW4 lpdd; // dd object < Problem line

...
extern LPDIRECTDRAWSURFACE4 lpddsprimary; // dd primary surface
extern LPDIRECTDRAWSURFACE4 lpddsback; // dd back surface

Hi,

I tried to compile the freakout game myself, and it worked perfectly. I also tried making common mistakes during set-up of project, but still, it worked. Although i remember having this problem myself i can''t recollect how i fixed it. It could be as simple as putting a semicolon in the line before the ones you showed me, or maybe download a new version of directx (although i tested with the one included in VC++ 6.0.

good luck!



Parklife
-------------
Confidence is a preference for the habitual voyeur of what is known as... (Parklife!)

Hey,
First off, I own Windows Game Programming Gurus and it is a really great book. However, its directx is a little out of date. Lamothe is using directx 4... the current version of directx is 8. I started programming off that book, but I never compiled any of his programs because I figured all I'd get from compiling it is the executable that is already on the cd... so why do it? I'd reccomend downloading directx 8, looking for tutorials on the net to getting comfortable with using it and compiling it. Also included with dx8 are some examples which I used to teach myself how to program directdraw. Now about the book, I use it all the time because it has a great physics section, and it also covers AI, collision detection, and much more that will help when programming your games. So basically just learn from the algorithms in the book and don't copy them word for word because chances are they won't work . I know it sounds like a lot of work, but no one said it would be easy, but in the end it is a very rewarding "hobby" (for me at least). Good luck,
-Jesse

Edited by - webmunkey on August 3, 2001 1:35:43 AM
to answer your question, it seems that ddraw.h is not included or the compiler cant find it or a better one, he find a old version that has been provided with Visual C++ witch is the fifth version, and I think that the demo needs the sixth version to compile

add the directories in your config of visual c++ to the Include directory of the DX SDK, and the same for the Libraries

cyberg
cyberg- cyberg_coder@hotmail.com- http://members.xoom.com/cybergsoft
quote:However, its directx is a little out of date. Lamothe is using directx 4... the current version of directx is 8.


Actually, in Windows Game Programming for Dummies, Lamothé covers directx 5.0 and in Tricks of the Windows Game Programming Gurus, he uses 6.0.

that''s all, folks!



//John

-------------
Confidence is a preference for the habitual voyeur of what is known as... (Parklife!)

This topic is closed to new replies.

Advertisement