d3dx doesn't want to work
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]
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 ]
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
To fix this you can either:
------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.
- typedef unsigned int* UINT_PTR;
- #include <windows.h>
------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.
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!
They don''t work. Try to download the DX8.1 VC++ SDK Component instead.
______________________________
Oooh, you found the horadric cube!
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]
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]
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]
Do you have the latest service pack for VC++ 5?
From the docs:
DirectX 8.1 supports only Microsoft Visual C++ 5.0 SP3 and later
Stay Casual,
Ken
Drunken Hyena
From the docs:
DirectX 8.1 supports only Microsoft Visual C++ 5.0 SP3 and later
Stay Casual,
Ken
Drunken Hyena
Additionally, you may want to download the latest Platform SDK from Microsoft. That should clean up those type issues.
Stay Casual,
Ken
Drunken Hyena
Stay Casual,
Ken
Drunken Hyena
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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement