使用相对路径在 Visual Studio 中包含 MASM 的库

Use relative path to include libraries for MASM in Visual Studio

我试图将我的路径 C:\masm32 添加到 Project -> Properties -> Microsoft Macro Assembler -> General -> Include Paths 中的 Include Paths。然后汇编程序使用以下命令编译我的项目:

ml.exe /c /nologo /Zi /Fo"Debug\test.obj" /l "C:\masm32" /W3 /errorReport:prompt /Tatest.asm"

其中确实包含我的库路径,但在我的代码中它一直告诉我只有 \include\kernel32.inc

的部分有错误

我的包括: ... includelib \lib\kernel32.lib ;These two .lib files seem to have includelib \lib\masm32.lib ;no error even if i remove the .inc files include \include\kernel32.inc ;It only reports error for .inc files include \include\masm32rt.inc ;cannot open file: \include\kernel32.inc ... 这与用于 include \include\... 的相同关键字有什么关系吗?

我通过删除前导 \ 解决了这个问题,所以它变成了 include include\kernel32.inc