Archived

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

pandabear114

Compiling "FreakOut" from Tricks of the Windows Game Programming Gurus

Recommended Posts

Hello, I am fairly new to C++ programming and I was told the book Tricks of the Windows Game Programming Gurus was a good book to get to start out. I read through the first chapter in which it discusses the sample game FreakOut, and at the end it suggested to go through and try changing things about the game. I attempted to just compile it originally but I recieved four errors: --------------------Configuration: BreakOut - Win32 Debug-------------------- Compiling... blackbox.cpp c:\documents and settings\tyler yates\desktop\freakout\blackbox.h(33) : error C2146: syntax error : missing ';' before identifier 'lpdd' c:\documents and settings\tyler yates\desktop\freakout\blackbox.h(33) : fatal error C1004: unexpected end of file found breakout.cpp c:\documents and settings\tyler yates\desktop\freakout\blackbox.h(33) : error C2146: syntax error : missing ';' before identifier 'lpdd' c:\documents and settings\tyler yates\desktop\freakout\blackbox.h(33) : fatal error C1004: unexpected end of file found Error executing cl.exe. BreakOut.exe - 4 error(s), 0 warning(s) I then went into the code to see what was at that location and line it is: // EXTERNALS ////////////////////////////////////////////////// extern LPDIRECTDRAW4 lpdd; // dd object extern LPDIRECTDRAWSURFACE4 lpddsprimary; // dd primary surface extern LPDIRECTDRAWSURFACE4 lpddsback; // dd back surface extern LPDIRECTDRAWPALETTE lpddpal; // a pointer to the created dd palette extern LPDIRECTDRAWCLIPPER lpddclipper; // dd clipper extern PALETTEENTRY palette[256]; // color palette extern PALETTEENTRY save_palette[256]; // used to save palettes extern DDSURFACEDESC2 ddsd; // a direct draw surface description struct extern DDBLTFX ddbltfx; // used to fill extern DDSCAPS2 ddscaps; // a direct draw surface capabilities struct extern HRESULT ddrval; // result back from dd calls extern DWORD start_clock_count; // used for timing Line 33 is the first extern line. I did a search on google to see exactly how LPDIRECTDRAW4 should be used and defined, and I found out it is part of DirectDraw. I then remembered reading something about DirectX 8.1 making DirectDraw hard to access and/or more confusing and I thought that my problem might have been that I was using DirectX 8's SDK. I uninstalled the SDK and put on DirectX 6 SDK that came on the CD with the book, however I still recieved the same error. It doesn't make sense to me that I would need to change DirectX runtime files to 6.0 instead of 8.1 (does it?). I am sorry if I do not make any sense because I do not know exactly what I am talking about, but any help would be great. Thanks [edited by - pandabear114 on June 8, 2002 9:33:07 PM]

Share this post


Link to post
Share on other sites
This must be the billionth time someone has asked this. If people read the book CAREFULLY, they would see that LaMothe says SEVERAL times that you need to add the DirectX Libs directly to your project. Chances are, you haven't done this and that's what's wrong.

I congratulate you on doing some research on the topic before posting, though. Most people don't even do that.


Things are not what they are.




[edited by - myme15 on June 8, 2002 9:47:43 PM]

Share this post


Link to post
Share on other sites
Actually, when I first had the error I double checked and saw that he mentioned that. I added all the ddraw.lib file mentioned, and then ended up just tossing them all in, from the \SDK\lib\ directory directly to the project, but I still recieved the error.

[edited by - pandabear114 on June 8, 2002 9:53:49 PM]

Share this post


Link to post
Share on other sites
Still? Do you have your paths set up properly?

As in, have you gone to Tools -> Options -> Directories and checked that your DirectX SDK folders are on the top of the list? They have to be on the top of all the lists there or else it won't work.

Or are you not using MSVC++? If not, then you may have to do something different to get it all to work.



Things are not what they are.


[edited by - myme15 on June 8, 2002 9:56:28 PM]

Share this post


Link to post
Share on other sites
If you search the forums for "identifier lpdd", basically the entire page of results is almost completely people asking this question. I think LaMothe should have devoted a chapter to this issue, as nobody seems to get it




Things are not what they are.

Share this post


Link to post
Share on other sites