可以64位Delphi目标静态链接到编译的C对象文件吗? [英] Can 64 bit Delphi targets statically link to compiled C object files?

查看:141
本文介绍了可以64位Delphi目标静态链接到编译的C对象文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的32位Delphi 2010应用程序使用 $ LINK 编译器指令链接到多个C对象文件。我可以在Delphi XE2目标64位吗?

My 32 bit Delphi 2010 application links to a number of C object files using the $LINK compiler directive. Can I do this in Delphi XE2 when targetting 64 bit?

我正在使用bcc32版本5.5进行编译,但是我不介意我使用的是哪个编译器Embarcadero C编译器尚未输出64位对象。

I am currently compiling using bcc32 version 5.5, but I don't mind which compiler I use if it turns out that the Embarcadero C compiler does not yet output 64 bit objects.

推荐答案

是的。您必须将C对象文件编译为COFF格式。这通常意味着英特尔和/或MSVC ++编译器。同样的注意事项适用于适用于32位的64位对象文件链接。您必须确保所有外部引用已正确解析,方法是提供另一个具有该符号的.obj,或从Delphi代码。构建C代码时,请确保禁用任何堆栈检查或其他运行时验证码生成。许多时候,这样的代码依赖于给定工具的特定版本的C / C ++ RTL。

Yes. You must compile the "C" objects files to COFF format. This usually means either the Intel and/or MSVC++ compilers. The same caveats apply to 64bit object file linking that apply to 32bit. You must ensure that all external references are properly resolved, either by providing another .obj which has that symbol, or from Delphi code. When building the "C" code, make sure you disable any stack checks or other run-time verification code generation. Many times such codegen relies on a specific version of the C/C++ RTL from the given tool.

其他值得注意的是,Delphi 64位可以链接到COFF对象文件(最终还将支持ELF64),32位Delphi支持与C ++ Builder内置的OMF对象文件链接,可以使用MSVC ++构建的XE2,32位COFF对象文件。同样的注意事项也适用。

Something else worth noting is that while Delphi 64bit can link to COFF object files (eventually it will also support ELF64), 32bit Delphi supports linking with C++Builder built OMF object files and, new to XE2, 32bit COFF object files which can be built with MSVC++. The same caveats apply.

这篇关于可以64位Delphi目标静态链接到编译的C对象文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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