numerical25
numerical25

Reputation: 10790

error LNK2001: unresolved external symbol _D3DX10CreateTextureFromFileW@24

I am trying to call a direct X funciton but I get the following error

error LNK2001: unresolved external symbol _D3DX10CreateTextureFromFileW@24

I understand that possibly there maybe a linker issue. But I am not sure where. I inluded both d3dx10.h and the d3d10.h. I also included the d3d10.lib file. Plus, the intellisense picks up on the method as well. below is my code. The method is D3DX10CreateTextureFromFile

bool MyGame::InitDirect3D()
{
    if(!DX3dApp::InitDirect3D())
    {
        return false;
    }

    ID3D10Resource* pD3D10Resource = NULL;
    HRESULT hr = D3DX10CreateTextureFromFile(mpD3DDevice,
                                                L"C:\\delete.jpg",
                                                NULL,
                                                NULL,
                                                &pD3D10Resource,
                                                NULL);
    if(FAILED(hr))
    {
        return false;
    }

    return true;
}

Upvotes: 0

Views: 667

Answers (2)

Alex F
Alex F

Reputation: 43311

You need D3DX10.lib: http://msdn.microsoft.com/en-us/library/bb172671%28VS.85%29.aspx

Upvotes: 1

Michael Burr
Michael Burr

Reputation: 340208

Is the appropriate DirectX library (or libraries) configured inthe project or makefile (or whatever build system is being used)?

For this particular function , it's D3DX10.lib.

Upvotes: 3

Related Questions