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

huangapple go评论65阅读模式
英文:

Use relative path to include libraries for MASM in Visual Studio

问题

我尝试将我的路径C:\masm32添加到项目 -> 属性 -> Microsoft宏汇编器 -> 通用 -> 包含路径中。然后汇编器使用以下命令编译我的项目:

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

这个命令包括了我的库路径,但在我的代码中,它不断告诉我只有\include\kernel32.inc部分出现错误。

我的包含部分:

...
includelib \lib\kernel32.lib   ;即使删除了.inc文件,这两个.lib文件似乎没有错误
includelib \lib\masm32.lib     ;仅对.inc文件报告错误
include \include\kernel32.inc  ;无法打开文件:\include\kernel32.inc
include \include\masm32rt.inc  ;...

这是否与include \include\...中使用的相同关键字有关?

英文:

I tried to add my path C:\masm32 to Include Paths in Project -> Properties -> Microsoft Macro Assembler -> General -> Include Paths. The assembler then compiles my project with the command:

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

Which did include my path to libraries but in my code it keeps telling me to have error at only the part for the \include\kernel32.inc

My includes:

...
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
...

Does this have anything to do with the same keyword used for include \include\... ?

答案1

得分: 0

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

英文:

I fixed the problem by removing the leading \ so it became include include\kernel32.inc.

huangapple
  • 本文由 发表于 2020年1月3日 13:22:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/59573567.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定