3 Replies - 1169 Views - Last Post: 30 May 2013 - 10:41 PM Rate Topic: -----

#1 bubble_fellow  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 29-May 13

following braynzarsoft DirectX 11 Tutorial - D3DX11CompileFromFile err

Posted 29 May 2013 - 10:49 PM

I've been following tutorial 4 here: http://www.braynzars...p?p=DX11Lessons for drawing a simple triangle.

I have created an Effects.fx file, and receive this error when calling D3DX11CompileFromFile:

1>main.obj : error LNK2019: unresolved external symbol _D3DX11CompileFromFileA@44 referenced in function "bool __cdecl InitScene(void)" (?InitScene@@YA_NXZ)

I'm including the same libraries and headers as he is, and have tried including numerous others such as D3DCompiler.lib.

#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dx11.lib")
#pragma comment(lib, "d3dx10.lib")

//Include necessary Headers//
#include <windows.h>
#include <d3d11.h>
#include <d3dx11.h>
#include <d3dx10.h>
#include <xnamath.h>


The D3DX11CompileFromFile calls looks like this, where hr is an HRESULT:

hr = D3DX11CompileFromFile("Effects.fx", 0, 0, "VS", "vs_5_0", 0, 0, 0, &VS_Buffer, 0, 0);
hr = D3DX11CompileFromFile("Effects.fx", 0, 0, "PS", "ps_5_0", 0, 0, 0, &PS_Buffer, 0, 0);


Anyone know why I might be receiving this linker error?

Is This A Good Question/Topic? 0
  • +

Replies To: following braynzarsoft DirectX 11 Tutorial - D3DX11CompileFromFile err

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: following braynzarsoft DirectX 11 Tutorial - D3DX11CompileFromFile err

Posted 30 May 2013 - 04:01 PM

Why are you including both d3dx11.lib and d3dx10.lib? Have you tried not including d3dx10.lib for instance? I'm guessing there could be a conflict.

And remove this

#include <d3dx10.h>

too.

This post has been edited by ButchDean: 30 May 2013 - 04:02 PM

Was This Post Helpful? 0
  • +
  • -

#3 bubble_fellow  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 29-May 13

Re: following braynzarsoft DirectX 11 Tutorial - D3DX11CompileFromFile err

Posted 30 May 2013 - 09:36 PM

I'm including d3dx10.lib since it includes it in the tutorial. I removed d3dx10.lib and #include <d3dx10.h> and it complained about D3DXCOLOR, so apparently it is used for that. I changed D3DXCOLOR to a float mycolor[4] and it solved the D3DXCOLOR issue, but the original error complaining about D3DX11CompileFromFileA returned.

Another point to make: once I commented out the D3DX11CompileFromFileA, it compiled and launched the application but crashed immediately. So it is the only linker issue.
Was This Post Helpful? 0
  • +
  • -

#4 bubble_fellow  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 29-May 13

Re: following braynzarsoft DirectX 11 Tutorial - D3DX11CompileFromFile err

Posted 30 May 2013 - 10:41 PM

Looks like I found my answer.

Quote

Note The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated for Windows 8 and is not supported for Windows Store apps.


Source: http://msdn.microsof...1(v=vs.85).aspx

I'm using Windows 8.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1