E2045错误的目标文件格式:"XXX.obj"; [英] E2045 Bad object file Format:"XXX.obj"

查看:146
本文介绍了E2045错误的目标文件格式:"XXX.obj";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个从x32位到x64的移植项目. 在这里,我使用以下代码:

I am working on one migration project from x32 bit to x64. Here I am using this code:

{$L com_1.obj}
{$L com_is1.obj}
{$L com_2.obj}

但是在编译代码时,我得到了

But while compiling code I am getting error as

[dcc64 Error] XXX.dpr(919): E2045 Bad object file format: 'E:\MyProj\com_sha.obj'

我无法追踪其发生原因.

I am not able to trace why it is happening.

是否由于32位obj文件用于编译x64位delphi项目?

Is it due to 32 bit obj file used for compiling x64 bit delphi project?

如果是的话,我也曾尝试用x64位环境创建obj文件.

If it is I have also tried to create a obj file with x64 bit environment.

有人可以帮我吗?

我正在使用Delphi 10 Seattle.

推荐答案

您不能在64位编译器中使用32位对象.您必须使用64位编译器重新编译代码.

You cannot use a 32 bit object with the 64 bit compiler. You must recompile your code with a 64 bit compiler.

您可以使用许多不同的编译器来执行此操作.尽管我听说有人成功使用gcc,但我从未设法做到这一点.我相信可以使用基于Clang的现代Embarcadero编译器,但是我个人没有任何经验.我一直使用Microsoft编译器来创建64位对象.当然,这是Embarcadero自己对链接到RTL的zlib之类的库所做的.

You can use a number of different compilers to do this. Although I have heard of people succeeding with gcc I have never managed to do that. I believe that the modern Clang based Embarcadero compiler can be used, but I personally have no experience of that. I have always used the Microsoft compiler to create 64 bit objects. And certainly this is how Embarcadero themselves have done it for libraries like zlib that they link to their RTL.

这篇关于E2045错误的目标文件格式:"XXX.obj";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆