c++ - error C3861: 'D3DCompileFromFile': identifier not found -


I'm trying to use the D3D function D3DCompilFromFile and it was working perfectly fine, as long as I Your shader has made a little change and now all of a sudden stopped my program recognizing the D3DCompileFromFile function, I have checked what header / libraries / dll I need to include and they see all for my information.

I am using VS2013

Here are some example codes

application.cpp

  HRESULT application :: CompileShaderFromFile (WCHAR * szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob ** ppBlobOut) {HRESULT HR = S_OK; DWORD dwShaderFlags = D3DCOMPILE_ENABLE_STRICTNESS; #if define (DEBUG) || Define (_DEBUG) // To set debug info in the senders, set D3DComIEl_DBUG flag. // Setting this flag makes the shader debugging experience better, but still allows to customize / shaders and the way they will run in the release configuration of this program, DwShaderFlags | = D3DCOMPILE_DEBUG; #endif ID3DBlob * pErrorBlob; Hour = D3DCompileFromFile (szFileName, nullptr, nullptr, szEntryPoint, szShaderModel, dwShaderFlags, 0, ppBlobOut, & amp; pErrorBlob); If (FAILED (HR)) {if (pErrorBlob! = Nullptr) output debug string ((* four *) peerblob-> GetBufferPointer ()); If (pErrorBlob) pErrorBlob- & gt; Release (); Returns HR; } If (pErrorBlob) pErrorBlob- & gt; Release (); Return S_OK; }  

application.h

  #include & lt; Windows.h & gt; # Include & lt; D3d11_1.h & gt; # Include & lt; D3dcompiler.h & gt; #include & lt; Directxmath.h & gt; #include & lt; Directxcolors.h & gt; #include "resource.h" #include & lt; Iostream & gt; # Include & lt; Vector & gt; # Include & lt; Time.h> # Include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Using Namespace DirectX; using namespace std; . . . . HRESULT CompileShaderFromFile (WCHAR * szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob ** ppBlobOut);  

Light. Fx

  CBfear CBData {Float 4x4 World; Float4x4 view; Float4x4 projection; Float4 gDiffuseMtrl; Float4 gDiffuseLight; Float3 gLightVecW; Float4 gAmbientMtrl; Float4 gAmbientLight; }; Struct VS_IN {float4 posL: POSITION; Float3 General L: Normal; }; Struct VS_OUT {float4 Pos: SV_POSITION; Float4 Colonel: Color; }; Vs_UUT VS (VSNN VN) {VSUUU output = (VS_UUT) 0; Output.Pos = mul (vIn.posL, World); Output.Pos = mul (Output. Piece, see); Output.Pos = mul (output.Pos, Projection); // local to global normal float 3 normal w = mul (float4 (vIn.normalL, 0.0f), world) .xyz; Normal w = normal (normal); // Compute Color Float s = Max (dot (GLETVCEW, normal W), 0.0f); Float3 diffuse = s * (gDiffuseMtrl * gDiffuseLight) .rgb; Float3 environment = gambientmtmllm * gmbiite light; Output.Col.rgb = Expand + environment; Output.Col.a = gDiffuseMtrl.a; Return output; } Float 4 PS (VS_UUT PIN): SV_Gatez {Return PIN.Coll; } Render tech 11 {Pass P {Set VertexShader (Composer Shader (vs.GG, VS ()); SetGematricator (NULL); SetPixelShader (compose shader (ps_4_0, ps ()); Sorry if I'm throwing too much code on people, but I'm really struggling to find out the reason for this reason.   

Are you using it? D3DCompileFromFile You are probably raising the old 'd3dcompiler.h' title in the DirectX SDK but not compared to the newer Windows 8.1 SDK version of 'd3dcompiler.h, which means that the old # 43 version exists Was not that 'VS Came with 2013

Ideally you should not use DirectX SDK at all. (See).

I see from my shader that you are using Effect 11, then make sure you do not need any DXSDK headers, keep in mind that support for 'fx_5_0' profile dislikes and The future updates of the HLSL compiler are likely to occur. The compiler's Windows 8.1 SDK # 47 version will emit a warning given, but will still compile these shaders.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -