使用 MASM 64 位时出现 LNK1104

LNK1104 when using MASM 64bit

我目前正在尝试学习 x64 的程序集 Windows。我尝试了 this Intel website 中的示例代码, 但是每当我尝试使用文档中给出的命令编译它时:

ml64 hello.asm /link /subsystem:windows /defaultlib:kernel32.lib /defaultlib:user32.lib /entry:Start

我总是得到

LNK1104 error

我知道这意味着编译器找不到库文件,我搜索了这个问题,很快发现我需要 Visual Studio 和 Windows SDK,我下载并安装了它。但是在 Windows 系统文件以外的任何文件中仍然找不到 kernel32.libuser32.lib

我什么都试过了,就是无法修复。我希望有人能帮助解决这个问题。

有一个著名的 MASM32 SDK available 由 hutch-- 创建。此软件包包含(旧版)32 位版本中请求的库。

但是 hutch--:
也对那个著名的软件包进行了 64 位更新 Current build of the 64 bit MASM SDK.
它应该包含您需要的 .inc.lib 文件以及更多...

This is the current build of the 64 bit MASM SDK. This one is a lot closer to complete and with the correct Microsoft binaries added to it, it is capable of building a wide array of application types. It can be use in 2 different ways, it should be unzipped from the root directory of the partition that it is being installed on. You can either manually add it to an installation of the MASM32 SDK OR you can install it on a partition that does not have MASM32 on it and simply rename the buildx64 directory to MASM32. Installing it on another partition is the preferred technique as QE has its menus and accessories set up for building 64 bit code.

You still need to add the Microsoft binaries which would typically be from an installation of vs2017 or from an earlier version for Win7 64. In the bin64 directory there is a file called "Microsoft_File_List.txt" which shows the files you need. The list is from the current version of Visual Studio 2017 version and if this is the version you have, use the ML64 from the "x86_amd64" directory that is 402,584 bytes in size.

In the "buildx64" directory is a batch file called "makeall.bat". This must be run to build all of the libraries and include files.

它们是 Windows 汇编开发的黄金标准。