Page 1 of 1
Game Guru book, source error?

Posted:
Jul 25, 2001 @ 5:26pm
by RwGast
I just got that book Tricks of the Windows Game Programming Guru's. I bought it becuase i saw it had a high reccomendation everywhere, and i saw people on this board refer to it quite a few times. But i belive there may be somthing wrong with the source code for freak-out, the first game in the book. I have added ddraw.lib and ddraw.h into my workspace, along with Freakout.cpp and the blackbox files but msvc++6 gives me an error in blackbox.h when i try to compile an exe. The error is<br><br>blackbox.h(34)"Missing ';' before identifer lpdd"<br>blackbox.h(34)"unexpected end of file found"<br><br>blackbox.h(34)"Missing ';' before identifer lpdd"<br>blackbox.h(34)"unexpected end of file found"<br>4 errors 0 warnings<br><br>Ya thats right the same errors twice. I checked out the .h file and there wasn't any ; missing. I was just wondering since this seams to be a popular book if anyone knows the fix for this.<br><br>Also does anyone know how to turn on line numbers in msvc++ 6?
Re: Game Guru book, source error?

Posted:
Jul 25, 2001 @ 5:45pm
by Moose or Chuck
look through the header file mentioned around line 34 (just right click the error and press Go To Error) and look for any general mistakes, like no " or ) where they should be. That would cause that error too. I don't think I ever tried to compile the game from the source on the CD, so I'd have to go back and look through it. <br><br>And yes, errors and typos are in books, so watch out for em. It's the autor's way of testing your knowledge (like how bugs in Windows are features).<br><br>The line number should be displayed in the status bar down towards the bottom of the MSVC++ window. But if you ever get an error message that tells you the line number, just right click on the error message and there will be an option to take you right to the error.
Re: Game Guru book, source error?

Posted:
Jul 25, 2001 @ 5:49pm
by Digby
Here's a wild guess as to the cause of your problem:<br><br>Make sure that ddraw.h is included before that header file.<br><br>Go to Tools/Options/Directories and make sure that the DX include and library directories are the first items in the lists (ahead of the VC headers and libs).<br><br>There isn't a way to turn on line numbers in the Visual Studio editor (if that's what you're asking).<br><br>If you put the cursor on a line, the line number will show up in the status bar (bottom right). You can also type ALT+E+G and that will allow you to enter a line number to jump to. Or if you want to go to the next error/warning in the Build output window, press F4.<br>
Re: Game Guru book, source error?

Posted:
Jul 25, 2001 @ 6:04pm
by RwGast
Thanks guys im at work right now so i cant this stuff out but i never even did that Tools>Options>Directorys thing in the first place i didnt know you had to set up the path of the dx lib files. Is this most likely the reason for the problem.
Re: Game Guru book, source error?

Posted:
Jul 26, 2001 @ 2:08am
by DeFrAgGeD
Yeah that should fix the problem... After working with old school borland and qbasic you get used to looking for paths in the settings somewhere but hey that was a long time ago