DirectX issues.

Background and greetings: Hi I'm a university student studying computer games, as part of my course i must assemble a 2d game engine in C++ using Directx as a foundation. However I have hit a problem with directx.

despite having #include <d3d9.h> at the top of a .cpp and despite the functions to create and release the directx driver such as "CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,window_handle,D3DCREATE_SOFTWARE_VERTEXPROCESSING, &PresentParams, &m_driver);" working perfectly one particular command gives me an error when i try to compile that has proven to be a stumbling block to me.

error C3861: 'D3DXCreateTextureFromFile': identifier not found

This seems to be endemic to my system for some reason(i've made another test program and even there it does not recognize the command) and completely stalls my project as i need to be able to load images for sprites.

I am on windows 7 and i have tried using the directx sdk include and library directories for releases 2010 june, 2010 february and 2007 August and still it refuses to recognize the command either with MSVC 2010 or MSVC 2008.

I have verified that the command D3DXCreateTextureFromFile is defined in the sdk include folder in the file d3dx9tex.h though sadly I was unable to 'help the compiler along' by telling it to include that header as it claimed there was no such file or directory as d3dx9tex.h despite that file being clearly in the include directory that was listed in MSVCs inclusion directory settings.

Any idea as to how I'm to resolve this would be welcome, I have seen no relevant returns on google when i used the error as search terms so I'm honestly at a loss here. How do I convince my compiler to recognize this command again?

try this

#pragma comment(lib, "d3dx9.lib")

#include <d3d9.h>
#include <d3dx9.h>
Topic archived. No new replies allowed.