Sign in to follow this  
feverzsj

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

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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....)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
"
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by daviangel
"
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.


is the website :www.xgamestation.com??
i cant find any thread about the book

Share this post


Link to post
Share on other sites
Quote:
Original post by feverzsj
Quote:
Original post by daviangel
"
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.


is the website :www.xgamestation.com??
i cant find any thread about the book

Yes look in the forums there
http://205.158.110.70/ubbcgi/ultimatebb.cgi?ubb=forum&f=4&DaysPrune=365&SUBMIT=Go
Andre goes under the name necron there.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this