[求助]第一次接触MASM遇到问题,关于LINK问题,请各位HELP~
谢谢jr21066朋友在百忙之中给予回复我的"菜"贴~
可是E文的真是不懂呀,尤其是我建立了ASM文件之后,不知道怎么编译了,在CHM文档里是这样说明的.
引用了下面的话:
好了,现在保存例子,取名为msgbox.asm。把 ml.exe 的路径放到 PATH 环境变量中,键入下面一行 进行编译:
ml /c /coff /Cp msgbox。asm (译者注:命令行参数大小写是有区别的)
/c 是告诉MASM只编译不链接。这主要是考虑到在链接前您可能还有其他工作要做。
/coff 告诉MASM产生的目标文件用 coff 格式。MASM 的 coff 格式是COFF(Common Object File Format:通用目标文件格式) 格式的一种变体。在 UNIX 下的 COFF 格式又有不同。
/Cp 告诉 MASM 不要更改用户定义的标识符的大小写。若您用的是 hutch 的包含文件的话,在.model 指令下加入 "option casemap:none" 语句,可达到同样的效果。
当您成功的编译了 msgbox.asm 后,编译器会产生 msgbox.obj 目标文件,目标文件和可执行文件只一步之遥,目标文件中包含了以二进制形式存在的指令和数据,比可执行文件相差的只是链接器加入的重定位信息。
好,我们来链接目标文件:
link /SUBSYSTEM:WINDOWS /LIBPATH:c:\masm32\lib msgbox.obj
/SUBSYSTEM:WINDOWS 告诉链接器可执行文件的运行平台
/LIBPATH:〈path to import library〉 告诉链接器引入库的路径。
基于MASM8.2的基础上,我怎么看都没看明白.....