Advertisement

HELP COMPILING programs in TOTWGPG

Started by May 21, 2002 12:36 AM
6 comments, last by Shin Yamazaki 22 years, 3 months ago
Hi!! I''m a new member here and new to programming in general. I have bought Andre LaMothe''s, "Tricks of the Windows Game Programming Gurus", after reading the reviews... I have read all the way to chapter 3, BUT I haven''t been able to compile a single program of the ones included in the book. I''m using MS VC++, I''ve set the compiler to Win32.exe programs, I''ve added all the source files and DirectX.lib files and I always get these "unresolved ------ symbol", "missing ; before blah,blah"(even thou I see no need for and "unexpected end of file" ERRORS. Could somebody tell me what the heck I''m I doing wrong?!?!
up until about chapter 7 you don''t need to include the Direct X libs, however make sure you include WINMM.lib -- that''s needed for the most of them.

However I found that when Lamothe first started using pens and brushes in GDI there was an error in the code - someone sorted me out on that.

If you get an error that says something about not knowing what type of void* returned, put (HPEN) in front of the function on the line that happens *I think*.
Advertisement
Have you got two files called Stdafx.h and Stdafx.cpp included in your project? Also.. the problem garconbiftek is talking about is LaMothe doesn''t cast his brush type correctly when painting the window.. so you need (HBRUSH) or something like that put infront of your hbrBackground field for the window. If you have those two files, it is because you have precompiled headers set.. if you right click on your cpp file (not the stdafx.cpp) and click properties I think.. then there should be a drop down box, select it and find Precompiled Headers.. then in the options, select Do Not Use Precompiled Headers (or something to that effect) now try compiling again.
hmm... I don´t have WINMM.LIB included so I´m gonna try it out. Is this really necessary for the first three chapters??

By the way, to be more specific, for example: when I try compiling Andre´s freakout demo in chapter 1, I´m getting an error (missing ; ) right on the line where his externals start (I think it was lpdd something, directdraw something) in his blackbox.h file...

I´ll go try what you guys said anyway, thanks...
im in chapter 4 right now and they have all been compiling fine.
OK, I verified what I was doing and I´m currently compiling all programs up to chapter 3 without any problems, EXCEPT the freakout game, wich I STILL haven´t been able to compile.
As far as the HBRUSH thing, you people are right. LaMothe didn´t cast the hbrBackground field, so I did get that "void* whatever error". Hope I don´t have to bother anyone else with this...
Advertisement
Please refer to post #96078 Guru chap 1 user: Underdawg . . . anyway I was stuck until Oluseyi pointed out changing the lib and include dirs under Tools->Options->Directories then choose under "show directories for" include files . . . make sure you reference Andre''s DirectX dir as well as the Library files dir. I found that the DDraw.h in the VC98 dir is version 0x005 (open it up and see) now check the DDraw.h in his C:\(LOCALDIRGURUS)\DIRECTX\DIRECTXSDK\LIB dir . . . the version listed in that file is 0x006 . . . once you add the dirs to his files, move them to the top, before the dirs of VC98. That should solve the extern problem for ya, it did for me and I finally got a good build and played a victory game of FreakOut . . . now off to bed. =]
The strangest life I''ve ever known.-Jim
You don''t need to worry about compiling freakout for now, just look at the code of it, the point of it is so you can take a look at a fully working game and the parts of it.

This topic is closed to new replies.

Advertisement