首页 > 解决方案 > 为什么我必须将源 `.asm` 文件的 `Properties > General > Item Type` 设置为 `Microsoft Macro Assembler` ...?

问题描述

为什么我必须将源.asm文件设置Properties > General > Item Type Microsoft Macro Assembler,即使我已经为项目节点选择了选项Build dependencies > Build Customization > masm.

标签: visual-studioassemblymasm

解决方案


这可能取决于您使用的是哪个版本的 Visual Studio,但我记得使用其中一个版本自动选择 .asm 文件的 masm 似乎是一次性选项。在处理了多个版本的 Visual Studio 并遇到了某些版本的问题后,我手动设置每个 .asm 文件的属性以使用自定义构建工具(也关闭不参与构建,正如 John Kalane 所评论的那样),它正在工作对于我拥有的所有版本(VS2005、VS2010、VS2015、VS2019)。

32 位调试版本,对于发布版本 /Zi 不需要:

command line: ml /c /Zi /Fo$(OutDir)\example.obj example.asm
outputs: $(OutDir)\example.obj

64 位调试版本,对于发布版本 /Zi 不需要:

command line: ml64 /c /Zi /Fo$(OutDir)\example.obj example.asm
outputs: $(OutDir)\example.obj

推荐阅读