错题本

构建时报错1
1
2
3
4
>Creating library ..\..\bin\UmbraForward_debug64.lib and object ..\..\bin\UmbraForward_debug64.exp
>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
>..\..\bin\UmbraForward_debug64.exe : fatal error LNK1120: 1 unresolved externals
>Done building project "UmbraForward.vcxproj" -- FAILED.
原因

报错内容为编译正常,但构建exe时无法找到程序中的main入口。
渲染器使用窗口程序,因此程序入口为WinMain而非main,如果编译器在查找main入口说明项目的链接属性设置错误。
修改:项目属性->linker->System->SubSystem,选择Windows (/SUBSYSTEM:WINDOWS)。

构建时报错2
    >....../UploadBuffer.h(24,9): error C2102: '&' requires l-value
原因

&运算符需要左值,即需要一个存储在变量中的值,而不能是一个通过方法调用或计算得到的临时值。

构建后弹窗1

弹窗报错找不到 dxcompiler.dll

image-20261018143451523

原因

缺少指定的动态链接库。

解决方案:

step1:前往Releases · microsoft/DirectXShaderCompiler下载dll文件

step2:将dll文件保存到解决方案目录下的External/dxc下

step3:修改