• ### Popular Now

• 9
• 9
• 11
• 12
• 9

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

## Recommended Posts

This is the first time I've use the august sdk (obsolete already :(... ) anyways, I've just included <d3d9.h> and it comes up with these errors:
c:\program files\microsoft directx 9.0 sdk (august 2005)\include\d3d9types.h(1791) : error C2057: expected constant expression
c:\program files\microsoft directx 9.0 sdk (august 2005)\include\d3d9types.h(1791) : warning C4200: nonstandard extension used : zero-sized array in struct/union
Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array


Umm, here's the header in question?:
[source=cpp]
...
...
#define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)

typedef struct _D3DDEVINFO_RESOURCEMANAGER
{
// !!!! This is the line in question:
D3DRESOURCESTATS    stats[D3DRTYPECOUNT];
} D3DDEVINFO_RESOURCEMANAGER, *LPD3DDEVINFO_RESOURCEMANAGER;

typedef struct _D3DDEVINFO_D3DVERTEXSTATS
{
DWORD   NumRenderedTriangles;       /* total number of triangles that are not clipped in this frame */
DWORD   NumExtraClippingTriangles;  /* Number of new triangles generated by clipping */
} D3DDEVINFO_D3DVERTEXSTATS, *LPD3DDEVINFO_D3DVERTEXSTATS;
...
...


[edit:] Umm, for the line: #define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1) D3DRTYPE_INDEXBUFFER is a enum value = 7, i think that it is saying that D3DRTYPECOUNT isn't a constant? But it is isn't it?

##### Share on other sites
This might not be the problem, but the current DX SDKs don't support Visual C++ version 6. Other than that... maybe you aren't including the headers in a correct order?

##### Share on other sites
I am using VC++ 8.0 Express Beta 2, and the only include statement that I have is the following:

#include <d3d9.h>

So, i don't think that's the problem...
WIN32_LEAN_AND_MEAN should not affect it, should it?

I've changed D3DRTYPECOUNT to 8 (which is it's value) and it compiles fine now.. It's a workaround, but I'm sure it's not good...

##### Share on other sites
It seems you are compiling your code as C code.
Using a constant value as a previously defined constant is valid in C++, not in C. And warning C4200 is a level 2 warning in C, and a level 4 warning in C++. Assuming default warning level is 3 (/W3), you seems to be using C compilation ;)

Try to change to C++, it should work fine then :)