masm32 链接 2 个 .obj 文件(简单)
我刚刚开始学习 masm32,对 .obj 文件有点困惑,我以前使用过 C#,所以编译器为我链接,现在我有 qeditor,但我找不到组装多个 .asm 文件的选项。我有一个非常基本的程序:
Vector.asm (+ Vector.inc), ...is a vector
Matrix.asm (+ Matrix.inc), ...is a matrix
Main.asm ... is the main program where I do some Vector calculations
当我单独编译它们中的每一个时,我得到 3 个 .obj 文件,它们是什么?我查看了 makeit.bat 行:
\masm32\bin\PoLink /SUBSYSTEM:CONSOLE "console.obj"
所以我想我可以将其更改为
\masm32\bin\PoLink /SUBSYSTEM:CONSOLE "console.obj" "vector.obj" "matrix.obj"
编译我的整个程序,但我错了:(,任何人都可以帮助我成功创建一个 .bat (因为也许我想创建稍后,我需要一个.bat)将3个.obj文件编译成1个.exe?
I just started to learn masm32 and am a bit confused about the .obj files, I used C# before, so the compiler linked for me, now I have qeditor but I cant find an option to assemble multiple .asm files. I have a very basic program built of:
Vector.asm (+ Vector.inc), ...is a vector
Matrix.asm (+ Matrix.inc), ...is a matrix
Main.asm ... is the main program where I do some Vector calculations
When I compile each one of them seperate, I get 3 .obj files, what are they? I looked into the makeit.bat at the line:
\masm32\bin\PoLink /SUBSYSTEM:CONSOLE "console.obj"
so I thought I could just change it to
\masm32\bin\PoLink /SUBSYSTEM:CONSOLE "console.obj" "vector.obj" "matrix.obj"
to compile my whole program, but I was wrong :(, can anyone help me to successfully create a .bat (because maybe I want to create a little ide later, for which I would need a .bat) which compiles the 3 .obj files into 1 .exe?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉 PoLink,但标准链接器需要的不仅仅是 .obj 文件列表。它还需要知道您打算调用生成的 .exe(它可以假设您只给它一个 .obj 文件)。可能还需要一个入口点。如果您正在处理多个文件,甚至可能需要库定义。您确实需要阅读文档并了解它在命令行上需要什么......
I'm not familiar with PoLink, but a standard linker requires more than just a list of .obj files. It will also need to know what you intend on calling the resulting .exe (it can assume if you only give it a single .obj file). May also require an entry point. May even require library definitions if you're doing multiple files. You really need to read the docs and see what it wants on the command line...