I have in the Linker Additional Dependencies
D3D10.lib
D3DX10.lib
The linker has no problem finding and opening D3D10.lib which is in the same folder as the other one. Anyone know why Visual Studio 2010 wouldn't be able to open the D3DX10.lib?
typical MS program issue...can you post some source code? I really don't use the visual studio, did you know every version is uncompatible with the previous using certain codes? You can write code for a visual studio 2008 application and chances are it may not even compile under visual studio 10 because of the syntax styles ms introduces into each new version but hey if its all you got, by all means use it. I hope you get your problem fixed.
/*******************************************************************
* GetTexture2DFromFile
* Loads a texture from a file into a ID3D10Texture2D object
* Inputs - LPCWSTR the path and filename of the texture
* Outputs - pointer to a ID3D10Texture2D object
*******************************************************************/
ID3D10Texture2D* GetTexture2DFromFile(LPCWSTR filename)
{
ID3D10Texture2D* texture = NULL;
ID3D10Resource* pRes = NULL;
// Loads the texture into a temporary ID3D10Resource object
HRESULT hr = D3DX10CreateTextureFromFile(pD3DDevice, filename, NULL, NULL, &pRes, NULL);
//Make syure the teture was loaded successsfully
if (FAILED(hr))
{
return NULL;
}
// Translates the ID3D10Resource object into a ID3D10Texture2D object
pRes->QueryInterface(__uuidof( ID3D10Texture2D ), (LPVOID*)&texture);
pRes->Release();
// returns the ID3D10Texture2D object
return texture;
}
This bit of code is the lynch pin of the program. If I remove D3DX10.lib from the linker then the function D3DX10CreateTextureFromFile generates an unresolved external error. And when I comment out that bit of code the program runs and crashes instantly.
Yes, that's the book I am using. I don't understand why the linker cannot open the D3DX10 library when it can open the D3D10 library in the same folder. DirectX seems to want to be a pain in the ass just to piss me off.