首页
社区
课程
招聘
[求助]RadASM使用问题
2006-7-28 13:22 8069

[求助]RadASM使用问题

2006-7-28 13:22
8069
我在使用RadASM2.2.0.9链接《Intel汇编语言程序设计(第四版)》中配套源码的时候老是出现以下问题:
C:\Program Files\RadASM\Masm32\Bin\ML.EXE /c /coff /Cp /nologo /I"C:\Program Files\RadASM\masm32\include" "11.asm"
Assembling: 11.asm
C:\Program Files\RadASM\Masm32\Bin\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /LIBPATH:"C:\Program Files\RadASM\masm32\lib" /OUT:"11.exe" "11.obj"
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

11.obj : error LNK2001: unresolved external symbol _ExitProcess@4
11.obj : error LNK2001: unresolved external symbol _ClrScr@0
11.obj : error LNK2001: unresolved external symbol _Crlf@0
11.obj : error LNK2001: unresolved external symbol _ReadInt@0
11.obj : error LNK2001: unresolved external symbol _WriteInt@0
11.obj : error LNK2001: unresolved external symbol _WriteString@0
11.exe : fatal error LNK1120: 6 unresolved externals

构建时发生错误.
总共编译时间 109 毫秒

因为该书代码中都有Irvine32.inc头文件,估计是这个文件在链接时没连上,请知道的兄弟指点一二,谢谢!
注:我已经将Irvine32.inc和Irvine32.lib拷贝到了相关目录下!

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
打赏
分享
最新回复 (11)
雪    币: 2367
活跃值: (756)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
小虾 10 2006-7-28 13:28
2
0
在代码中有没有引入相关的*.lib文件?
像这样:
Includelib Kernel32.lib
雪    币: 235
活跃值: (100)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
lemony 1 2006-7-28 14:49
3
0
函数需要引入的头文件和库文件,可以在msdn上面查到。。
雪    币: 827
活跃值: (242)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
YIJUN 2006-7-28 15:52
4
0
首先,谢谢下虾子和lemony兄的指点。
我在文件头加上Includelib Kernel32.lib和Includelib Irvine32.lib之后文件编译链接都可以通过了,程序也能运行了,但是出现个新问题,本来按照书上说的程序运行后应该能看得见的,但是我这里却不能看见,只在进程里可以找到它,这次是不是又差了什么库文件没有包含哦!
看来书上配的例子也问题不少哦!
该程序代码如下,请帮我看看出了什么问题哦
TITLE Testing the Link Library                 (TestLib.asm)

; Testing the Irvine32 Library.
; Last update: 09/8/01

INCLUDE Irvine32.inc
Includelib Irvine32.lib
Includelib Kernel32.lib

CR = 0Dh                ; carriage return
LF = 0Ah                ; line feed

.data
rand1   BYTE "Generating 20 random integers between "
        BYTE "0 and 990:",CR,LF,0
rand2   BYTE "Generating 20 random integers between "
        BYTE "0 and FFFFFFFFh:",CR,LF,0
prompt1 BYTE "Press a key: ",0
prompt2 BYTE "Enter a 32-bit signed integer: ",0
prompt3 BYTE "Enter your name: ",0
msg1    BYTE "The following key was pressed: ",0
regs    BYTE "Displaying the registers:",CR,LF,0
hello   BYTE "Hello, ",0

buffer  BYTE 50 dup(0)
dwordVal DWORD ?

.code
main PROC
; Set text color to black text on white background:
        mov  eax,black + (white * 16)
        call SetTextColor
        call ClrScr                ; clear the screen
        call Randomize                ; reset random number sequence

; Generate 20 random integers between 0 and 999.
; Put a delay between each.
        mov  edx,OFFSET rand1                ; display message
        call WriteString
        mov  ecx,20                ; loop counter
        mov  dh,2                ; screen row 2
        mov  dl,0                ; screen column 2

L1:        call Gotoxy
        mov  eax,1000                ; indicate top of range + 1
        call RandomRange                ; EAX = random integer
        call WriteDec                ; display in unsigned decimal
        mov  eax,500
        call Delay                ; pause for 500 milliseconds
        inc  dh                ; next screen row
        add  dl,2                ; move 2 columns to the right
        Loop L1

        call Crlf                ; new line
        call WaitMsg                ; "Press [Enter]..."
        call ClrScr                ; clear screen

; Input a signed decimal integer and redisplay it in
; various formats:
        mov  edx,OFFSET prompt2                ; "Enter a 32-bit..."
        call WriteString
        call ReadInt                ; input the integer
        mov  dwordVal,eax                ; save in a variable
        call Crlf                ; new line
        call WriteInt                ; display in signed decimal
        call Crlf
        call WriteHex                ; display in hexadecimal
        call Crlf
        call WriteBin                ; display in binary
        call Crlf

; Display the registers:
        call Crlf
        mov  edx,OFFSET regs                ; "Displaying the registers:"
        call WriteString
        call DumpRegs                ; display registers and flags
        call Crlf

; Display memory:
        mov  esi,OFFSET dwordVal                ; starting OFFSET
        mov  ecx,LENGTHOF dwordVal                ; number of units in dwordVal
        mov  ebx,TYPE dwordVal                ; size of a doubleword
        call DumpMem                ; display memory
        call Crlf                ; new line
        call WaitMsg                ; "Press [Enter].."

; Ask the user to input their name:
        call ClrScr                ; clear screen
        mov  edx,OFFSET prompt3                ; "Enter your name: "
        call WriteString
        mov  edx,OFFSET buffer                ; point to the buffer
        mov  ecx,SIZEOF buffer - 1                ; max. number characters
        call ReadString                ; input the name
        mov  edx,OFFSET hello                ; "Hello, "
        call WriteString
        mov  edx,OFFSET buffer                ; display the name
        call WriteString
        call Crlf

        exit
main ENDP
END main
雪    币: 2506
活跃值: (995)
能力值: (RANK:990 )
在线值:
发帖
回帖
粉丝
CCDebuger 24 2006-7-28 16:15
5
0
最初由 YIJUN 发布
首先,谢谢下虾子
........


测试链接库的程序,你没把那个Irvine32.dll文件放在编译好程序的同一个目录吧?
雪    币: 827
活跃值: (242)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
YIJUN 2006-7-28 17:07
6
0
最初由 CCDebuger 发布

测试链接库的程序,你没把那个Irvine32.dll文件放在编译好程序的同一个目录吧?


Irvine32.dll?我搜遍了整个盘都没见到这个文件,配套光盘里也没有这个东西,我把Irvine32.inc和Irvine32.dll放到目录下结果现象依旧!!!
雪    币: 2506
活跃值: (995)
能力值: (RANK:990 )
在线值:
发帖
回帖
粉丝
CCDebuger 24 2006-7-28 17:18
7
0
那是测试静态连接库?没有那个库,无法测试,只能靠猜。试试把这些都加到头文件里再编译看看,反正不会死人
include windows.inc
include user32.inc
include kernel32.inc
include shell32.inc
include comctl32.inc
include comdlg32.inc
include gdi32.inc

includelib user32.lib
includelib kernel32.lib
includelib shell32.lib
includelib comctl32.lib
includelib comdlg32.lib
includelib gdi32.lib
雪    币: 750
活跃值: (228)
能力值: ( LV9,RANK:780 )
在线值:
发帖
回帖
粉丝
非安全 17 2006-7-28 17:59
8
0
是不是没有RC资源文件?
雪    币: 827
活跃值: (242)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
YIJUN 2006-7-28 18:02
9
0
还是不得行,不知道是不是程序本身的原因!

不过还是谢谢CCDebuger大哥的指导~~
雪    币: 750
活跃值: (228)
能力值: ( LV9,RANK:780 )
在线值:
发帖
回帖
粉丝
非安全 17 2006-7-28 18:17
10
0
最好把工程打包上来,这样才好解决问题!
雪    币: 291
活跃值: (208)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
thebutterfly 5 2006-7-29 12:32
11
0
Irvine32.lib是一个静态库,是《Intel汇编语言程序设计(第4版)》的作者Kip Irvine写的一个控制台程序专用函数库

最初由 YIJUN 发布
我在使用RadASM2.2.0.9链接《Intel汇编语言程序设计(第四版)》中配套源码的时候老是出现以下问题:
Files\RadASM\Masm32\Bin\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0
........


所以楼主检查一下工程是不是按照控制台方式连接的

link ...... /SUBSYSTEM:CONSOLE....

另外,这个库运行的时候需要kernel32.dll, user32.dll, gdi32.dll这3个动态库,在其引入头文件Irvine.inc中已经包括了,可能是因为路径问题没有找到
雪    币: 827
活跃值: (242)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
YIJUN 2006-7-29 20:08
12
0
谢谢各位的帮助,我周一回公司再试下,因为它里面的代码都那样这么个头文件,如果编不通其他的题都没办法实践了

另外这个不是个资源文件!!
游客
登录 | 注册 方可回帖
返回