DirectX 10 Linker Error

In a DirectX program I get the following linker error:

LNK1104: cannot open file 'D3DX10.lib'

I have included the Directories

...\DirectXSDK (June 2010)\Include
...\""\Lib\x64
...\""\Lib\x86
...\""\Utilities\bin\x86

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?
Last edited on
This information:

-IDE being used
-Source code

Will help me (and others) help you.
Last edited on
closed account (3pj6b7Xj)
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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*******************************************************************
* 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.
LOL I'm stuck at this same spot. Are you reading the book "Beginning DirectX 10 Game Programming" ? I am, :P.

This is the line that is giving the issue: (Found from me testing a few days ago)

HRESULT hr = D3DX10CreateTextureFromFile(pD3DDevice, filename, NULL, NULL, &pRes, NULL);

But I'm not sure on how to fix the issue. =/
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.
Probably a messy file. Try downloading the SDK from microsoft.

http://msdn.microsoft.com/en-us/directx/aa937788
Uninstalled and reinstalled the SDK, no effect.
Topic archived. No new replies allowed.