DirectX compilation error: error MSB6006: "fxc.exe" exited with code 1

I am learning DirectX11 but can't get around this problem when compiling the project:

Error 1 error MSB6006: "fxc.exe" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 1126 5 DirectX

I am using Visual Studio 2013, DirectX 11, and the Effects framework.

I've searched the internet and did every single thing that they suggested such as properly setting the HLSL Compiler with fx as shader type and 5_0 as shader model. The include, lib and bin directories are properly set. There is a question on the topic here but it's not answered properly so I figured someone could explain how to overcome it now.

Thank you in advance.


You should configure HLSL file correctly. It means shader model(3.0, 4.0, 5.0), shader types(PS, VS, GS, or general just FX(with entry point if u got it) ....). fxc.exe is HLSL compiler which compiles your shader code, but it seems entire compiler is not targeted on right shader file(s). As well error says to you that compiler execution had been exited with result 1 , now you should click on shader(s) file with right mouse button and configure your shader that's it. Hope this helps.

P.S. Oh and which version of Windows do you use ? because it's matter how would you talking with DirectX SDK ? This is important.


 ? Link Problem DirectX: Linker problem
 ? Directx changes
 ? DirectX-11 Vertex Shader Runtime Compilation Issue
 ? DirectX 11 Map deviceContext failed
 ? MSB3073 exited with code 1
 ? MVC Core with Angular2: MSB6006 "tsc.exe" exited with code 1
 ? Cannot open dplay.lib error in VS2015
 ? My directx sound buffer has static noise
 ? My directx sound buffer has static noise
 ? My directx sound buffer has static noise