FXC : error X3501: 'main': entrypoint not found

若如初见. 提交于 2019-11-30 19:25:59

The option below only works on Visual Studio 2012 or later version.

If you compile a .fx file, you can set the shader type to "fx" as below:

  1. Right click your project in VS and select properties

  2. Expand the HLSL compiler option, select "Effect(/fx)" for Shader Type, you can also specify a entry point function for Entrypoint Name.

since VS2012 microsoft decided to include a HLSL compiler (that's where the error comes from), but you don't need it since you are loading and compiling the .fx file at runtime using the D3DX11CompileFromFile() function. So just exclude the .fx file from the build, right-click on the file in the solution explorer and choose properties->configuration properties->general->excluded from build->yes.

I equally have been working with that book and using the samples in VS 2013 and ran into the same error, when I came across your question.

In order to compile the samples you need to have the Project's Properties > Config. Properties > General > Platform Toolset to v100 (VS2010), so you won't see the HLSL Compiler options that zdd mentions in their answer because that comes with later versions of VS's toolset (e.g. having your Platform Toolset set to v120 (VS2013)).

Using the v100 toolset you can still set up the build process, as outlined in 6.8.5 Compiling an Effect at Build Time (p. 221), which configures it as a custom build step.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!