The latest program I'm trying to write is to display a bitmap image in a
window. My reference book instructs me to use the D3DXIMAGE_INFO struct,
which requires the <d3dx9tex.h> header. However, if I include <d3dx9tex.h>,
I get the following compiler error:
Compiling...
winmain.cpp
c:\program files\microsoft directx sdk (march 2009)\include\d3dx9shader.
h(955) : error C2146: syntax error : missing ';' before identifier
'HRESULT'
c:\program files\microsoft directx sdk (march 2009)\include\d3dx9shader.
h(955) : error C2501: 'DECLSPEC_DEPRECATED' : missing storage-class or type
specifiers
c:\program files\microsoft directx sdk (march 2009)\include\d3dx9shader.
h(955) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
tempo.exe - 3 error(s), 0 warning(s)
If I remove the "#include <d3dx9tex.h>" line, the compiler obviously fails
because it does not recognize the D3DXIMAGE_INFO struct.
I have pared down the application to a simple do-nothing WinMain(...) in
order to try to narrow down the problem. Still the problem revolves around
this header file.
Following is my do-nothing application for reference:
#include <windows.h>
#include <d3d9.h>
#include <d3dx9tex.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nShowCmd)
{
D3DXIMAGE_INFO imageInfo; // My textbook says I need "d3dx9tex.h" to use
this struct.
// Do nothing.
return 0;
}
I'm pretty stumped on what is wrong with my environment and what I need to
do to fix it. I appreciate any advice that anyone can offer.
> I am using MS Visual C++ 6.0 with service pack 6.
I don't think VC6 is supported. Check the docs.
You can download the free version of Visual Studio 2008 Express.
Also, the most active MS online community for DX is http://xna.com
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution