Jump to content
  • Advertisement

Archived

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

error

d3dx doesn't want to work

This topic is 5792 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After an absence of 3 years from dx programming I decided to pick it up again and just starting out on the basic stuff. So I come to use the D3DX library but I get the following error: C:\DXSDK\INCLUDE\d3dx8math.h(259) : error C2065: 'UINT_PTR' : undeclared identifier and this is the code BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); There is only one main cpp file and that includes D3DX8.h I've looked for UINT_PTR to see if it's a typedef anywhere but can't see it. Any ideas? Thanks. Oh I'm using VC++ 5 as well. Also, the same thing happens on any program I try to compile, i.e. the samples that come with the sdk not just my program. error: does not compute! [edited by - error on December 6, 2002 7:10:43 PM]

Share this post


Link to post
Share on other sites
Advertisement
Well, my copy of d3dx8math.h doesn''t include the code you mention, or any UINT_PTRs, or BYTES, or offsets, etc. I can''t see why a header would have that sort of code in anyway. Either you''ve given us the wrong file, you''re doing something very strange with macros, or my copy of the SDK is actually something else in disguise.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
To fix this you can either:

  1. typedef unsigned int* UINT_PTR;

  2. #include <windows.h>



------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.

Share this post


Link to post
Share on other sites
Did you try to use the prerelease version of DX8.1 headers? Those included with VC.NET?

They don''t work. Try to download the DX8.1 VC++ SDK Component instead.

______________________________
Oooh, you found the horadric cube!

Share this post


Link to post
Share on other sites
Strange. I expect it's going to be one of those simple things yet hard to spot :[

Anyway I download the sdk from Microsoft msdn and installed the debug stuff (have xp sp1 installed sp3 for vc as well)

http://msdn.microsoft.com/downloads/default.asp?url=/downloads/topic.asp?url=/msdn-files/028/000/114/topic.xml

I have tried including d3d8.h, windows.h and doing the typedef. That stops the first error but then I get

C:\DXSDK\INCLUDE\d3dx8math.h(259) : error C2296: '&' : bad left operand

so that's no good. Don't want to spend my time rewriting the math library do I

The code in question is part of this -> typedef struct _D3DXMATRIXA16 : public D3DXMATRIX, which starts on line 241 in d3dx8math.h.

Kylotan, you say your d3dx8math doesn't include the code I pasted, what does yours say on line 259 and 241?

Also, what compiler are you guys using?

Also as I said before this happens on the MS DX samples not just my program. All I have done is include D3DX8.h, my program compiles and runs fine if I don't include d3dx (but I wanted to start using it).

Thanks.



error: does not compute!

[edited by - error on December 7, 2002 5:48:27 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by GarlandIX
To fix this you can [...]
typedef unsigned int* UINT_PTR;


clearly you have no idea what UINT_PTR is, why post then?

UINT_PTR is an unsigned integer type which size is the same as the size of a pointer. it's used to aid in porting win32 code to win64. for win32, it's defined as (simplified)

typedef unsigned int UINT_PTR;

and for win64, it's defined as

typedef unsigned __int64 UINT_PTR;

you can find these typedefs in basetsd.h, and more details in msdn, such as here.

include <basetsd.h> before including d3dx8.h to fix the error.

the fact that including windows.h doesn't help most likely means that msvc include directories are before platform sdk/directx ones in your include path, which you may want to change. the windows.h header that came with vc5 is pretty old, and doesn't define win64-friendly types.

[edited by - niyaw on December 7, 2002 6:15:34 AM]

Share this post


Link to post
Share on other sites
Thanks niyaw, including basetsd worked.

But, my directories paths in Tools->Options->Directories are

C:\DXSDK\INCLUDE
C:\Program Files\DevStudio\VC\INCLUDE
C:\Program Files\DevStudio\VC\MFC\include
C:\Program Files\DevStudio\VC\ATL\include

so that should be ok shouldn't for windows.h?

At least I get on now.

DrunkenHyena - I got sp3, couldn't even compile anything until I got that, what fun I had 2 weeks ago with that I'll search msdn for that platform sdk.

Thanks.



_____________________________

error: does not compute!

[edited by - error on December 7, 2002 7:00:29 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!