2

For some reason, I have to use some assembly code in my dll library project. My visual studio version is 2019.

I follow the settings as below to build assembly code

  1. Project -> Build customizations, check masm
  2. In the property of my assembly code file, set Item Type to Microsoft Macro Assembler

Then I build the project and got the following error.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml64.exe /c /nologo /Zi /Fo"x64\Debug\my_assembly.obj" /W3 /errorReport:prompt /Tamy_assembly.asm" exited with code 1.

But if I go to my project directory and run ml64.exe with options in error message above, I can successfully build the assembly code.

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64\ml64.exe" /c /nologo /Zi /Fo"x64\Debug\my_assembly.obj" /W3 /errorReport:prompt  /Tamy_assembly.asm
 Assembling: my_assembly.asm

After the manual build of my_assembly.obj from commandline, the build also succeed in visual studio IDE.

What's wrong with the ml64.exe invoked from visual studio IDE?

alijandro
  • 11,627
  • 2
  • 58
  • 74
  • Possibly related: [Assembly programming - WinAsm vs Visual Studio 2017](https://stackoverflow.com/q/52796300) or [external assembly file in visual studio](https://stackoverflow.com/q/33751509) show what to click in VS. I don't use VS, so maybe you already did exactly what those suggest. – Peter Cordes May 14 '21 at 22:26

0 Answers0