problem in comipling examples in Tricks Of The 3D Game Programming Gurus

Started by
10 comments, last by daviangel 17 years, 7 months ago
i compiled some examples in chapter 7 of the book with my vc2005 compiler. but got a mass of errors such as "undeclared identifier" ,"cannot convert parameter"... i believe i've done right to the include files and lib files. any one can help me out?
Advertisement
Show us the code and error messages you're getting.
If its using DirectX and you are using a newer version of the SDK than what the examples were written for there have been changes to stucture names and parameters
on many calls. (ie DirectX8 to Directx9....)
not really
there are too many code involved
any one ever read the book and compiled successfully?
The book is fairly old; it needs to be compiled with the version of the compiler and the version of the Microsoft headers / SDK that it was intentionally intended for.

However, updating a piece of code to work with a newer SDK is something that you should know if you know the programming language you're using. If the intent of the book is to teach 3D programming, then you should already be able to do general programming. If you need to first learn how to use your tools effectively, perhaps a tutorial aimed more at those kinds of things would be more appropriate.
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
...it needs to be compiled with the version of the compiler and the version of the Microsoft headers / SDK that it was intentionally intended for.

As opposed to the versions it was unintentionally intended for? [smile]

@feverzsj:
Each error has an associated error code, and each error code has a corresponding entry page in MSDN that describes the error, common causes and fixes, with sample code. For each error you get, read the page and see what the problem is.

Each release of the DirectX SDK so far has included previous interfaces (this will not be the case for DirectX 10). In the case of Direct3D, for example, this is controlled by the D3D_SDK_VERSION symbol; set it to 0x0700 for Direct3D 7, which is what the book uses.

Of course, I'm presuming you've downloaded and installed the DirectX SDK. You have, right?
yeah
i think that is the problem.
i use the latest dxsdk.
it would be a tough work to convert all to right.

[Edited by - feverzsj on August 20, 2006 4:09:42 AM]
Quote:Original post by Oluseyi
Quote:Original post by hplus0603
...it needs to be compiled with the version of the compiler and the version of the Microsoft headers / SDK that it was intentionally intended for.

As opposed to the versions it was unintentionally intended for? [smile]

@feverzsj:
Each error has an associated error code, and each error code has a corresponding entry page in MSDN that describes the error, common causes and fixes, with sample code. For each error you get, read the page and see what the problem is.

Each release of the DirectX SDK so far has included previous interfaces (this will not be the case for DirectX 10). In the case of Direct3D, for example, this is controlled by the D3D_SDK_VERSION symbol; set it to 0x0700 for Direct3D 7, which is what the book uses.

Of course, I'm presuming you've downloaded and installed the DirectX SDK. You have, right?


em...
just add the D3D_SDK_VERSION symbol to the top of theWinMain cpp file???

#define D3D_SDK_VERSION 0x0700
right???

and some identifier has to be renamed to what it is in the dxinput.h.

according to the errors reported
firstly, i use cast to convert char to LPCWSTR ,such as "(LPCWSTR)WINDOW_CLASS_NAME(LPCWSTR)WINDOW_TITLE,"

but it made the string turn into chaos.
then i realized that i am not using unicode, so i turn off the unicode set of compiler

finally
compiled successfully

another problem is
the originally example .exe file and my compiled exe file only show with half of the window ,another half is always black

[Edited by - feverzsj on August 20, 2006 7:27:27 AM]
??????
"
can not find these functions," mmioAscend mmioRead mmioClose mmioDescend mmioOpen" ,the linker gave the errors.
so i temporarily removed these functions from cpp files.
"
You probably didn't link with the windows multimedia dll that's why you are getting above errors.
I have this book and I got the code to compile with a directx sdk from about a year ago so it shouldn't be too hard to do.
Also you might want to try Andre Lamothe's website since he probably already answered alot of questions like your on his message boards.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe

This topic is closed to new replies.

Advertisement