2014-10-04 64 views
1

我想寫我的第一個彙編語言的「Hello World」,但我一直收到此錯誤,指出不能打開文件「KERNEL32.LIB」:致命錯誤LNK1104:可以用匯編

致命錯誤LNK1104:無法打開文件'kernel32.lib'

我安裝的鏈接器是否有錯或者代碼有什麼問題?這裏是我的代碼

.386 
.model flat, stdcall 
option casemap:none 

include \masm32\include\windows.inc 
include \masm32\include\kernel32.inc 
include \masm32\include\masm32.inc 

includelib \masm32\lib\kernel32.lib 
includelib \masm32\lib\masm32.lib 

.data 

    HelloWorld db "Hello World!", 0 

.code 
start: 

    invoke StdOut, addr HelloWorld 
    invoke ExitProcess, 0 

end start 
+0

的代碼是確定。它在這裏像一個魅力(WinXP)。嘗試使用原始安裝程序從以下位置重新安裝MASM32:http://www.masm32.com/。 – rkhb 2014-10-04 19:42:26

+1

嘗試'includelib ' – 2014-10-04 20:33:17

回答

0

嘗試將項目文件保存在同一目錄中包含assemler

1

C:\masm32\bin文件夾試試這個在cmd中:

在Windows 10
link /SUBSYSTEM:WINDOWS /LIBPATH:c:\masm32\lib file.obj 
1

進出口運行MASM32並且此代碼完美鏈接 只需包含一些庫

.486       
.model flat, stdcall     
option casemap :none      

include \masm32\include\windows.inc  
include \masm32\macros\macros.asm  

include \masm32\include\masm32.inc 
include \masm32\include\gdi32.inc 
include \masm32\include\user32.inc 
include \masm32\include\kernel32.inc 

includelib \masm32\lib\masm32.lib 
includelib \masm32\lib\gdi32.lib 
includelib \masm32\lib\user32.lib 
includelib \masm32\lib\kernel32.lib 

。數據

HelloWorld db "Hello World!", 0 

.CODE 開始:

invoke StdOut, addr HelloWorld 
invoke ExitProcess, 0 

端開始

相關問題