masm32 链接 2 个 .obj 文件(简单)

发布于 2024-12-05 07:47:33 字数 635 浏览 1 评论 0原文

我刚刚开始学习 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南渊 2024-12-12 07:47:33

我不熟悉 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文