我在Windows XP SP3機器上安裝了masm32。我下載MASM32從這裏:masm32鏈接器不會創建可執行文件
http://www.masm32.com/masmdl.htm
安裝它。我將路徑C:\ masm32 \ bin添加到PATH環境變量中。現在,我正試圖組裝和鏈接一個示例程序。它創建目標文件但不創建可執行文件。
樣本程序:
include \masm32\include\masm32rt.inc
.data
MyTitle db "ASM!",0
MyText db "Some Text!",0
.code
start:
push 0
push offset MyTitle
push offset MyText
push 0
call MessageBoxA
call ExitProcess
end start
此外,請注意,這是目前在c默認LINK.EXE文件:\ MASM32 \而連接,如下所示bin目錄被扔一個錯誤:
Assembling: sample.asm
***********
ASCII build
***********
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"sample.obj+"
"sample.obj"
"sample.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : fatal error LNK1181: cannot open input file "sample.obj+"
我從這裏LINK.EXE的另一個版本:
http://download.microsoft.com/download/vc15/Update/1/WIN98/EN-US/Lnk563.exe
當我組裝和使用下面的命令鏈接:
ml.exe sample.asm sample.obj
它給人的錯誤:
Assembling: sample.asm
***********
ASCII build
***********
Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994
Copyright (C) Microsoft Corp 1984-1993. All rights reserved.
Object Modules [.obj]: sample.obj+
Object Modules [.obj]: "sample.obj"
Run File [sample.exe]: "sample.exe"
List File [nul.map]: NUL
Libraries [.lib]:
Definitions File [nul.def]:
LINK : fatal error L1104: \masm32\lib\masm32.lib : not valid library
感謝。我已經理解了:) –