Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiler error when including <d3dx9tex.h>

548 views
Skip to first unread message

Sherlock Helmlock

unread,
Apr 5, 2009, 8:13:19 PM4/5/09
to
Hi; I'm new to DirectX (and Windows) programming, and am in the early stages
of self-learning. I downloaded the DirectX 9 SDK from Microsoft, and have
created a few simple applications that create a Window and fill it with
various colors, etc. Because those beginning programs compiled and ran, I
believe that my development environment - include paths, library paths, etc.
- is properly set up. I am using MS Visual C++ 6.0 with service pack 6.

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.

url:http://www.ureader.com/gp/1470-1.aspx

The March Hare [MVP]

unread,
Apr 5, 2009, 11:32:06 PM4/5/09
to
On Mon, 6 Apr 2009 08:13:19 +0800, Sherlock Helmlock wrote:

> 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

0 new messages