C++ Builder DLL 无法链接 Delphi 包 (BPL) 中的单元 obj。如何修复它?

发布于 2024-09-15 23:45:42 字数 492 浏览 4 评论 0原文

我有一个必须链接到 Delphi 包 (BPL) 的 C++ Builder DLL,并且我认为可能需要重建 Delphi 包以允许 C++ Builder 和 Delphi 都使用它,但我不这样做知道需要在 Delphi 包上设置哪些选项。

当前的问题是链接C++ Builder包时找不到“UnitX.obj”(ILINK32错误),而UnitX是一个旨在在C++Builder和Delphi包之间动态链接的单元。

我认为改变 Delphi BPL 项目的链接选项应该足够了,如下所示:

Project Options ->Delphi Compiler->Linking ->linker output : 
   "Generate all C++ Builder files (including package libs)"

C++Builder DLL 已选中“运行时包”,并且“使用运行时包构建”列表已正确设置(它包含包含X 单元。)

I have a C++ Builder DLL that must link against a Delphi package (BPL), and I think it is possible that the Delphi package may need to be rebuilt to allow it to be used by both C++ Builder and Delphi, but I don't know which options need to be set on the Delphi package.

The current problem is that "UnitX.obj" is not found (ILINK32 error) when linking the C++ Builder package, and UnitX is a unit intended to be dynamically linked between C++Builder and Delphi packages.

I thought it should be enough to change the Delphi BPL project's Link options like this:

Project Options ->Delphi Compiler->Linking ->linker output : 
   "Generate all C++ Builder files (including package libs)"

The C++Builder DLL has "Runtime packages" checked, and "build with runtime packages" list is set up correctly (it contains the package that contains the UnitX.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

不忘初心 2024-09-22 23:45:42

问题出在链接包的搜索路径上。它找不到.DCP 文件,则无法链接。它似乎首先查找 DCP,默默地失败,然后查找有问题的编译单元(扩展名 .dcu),然后在 DCU 上给出错误,而不是丢失的 DCP。

如果您的搜索路径(dcu 和 dcp 搜索)并包含 (.hpp) 文件夹,则项目选项“生成所有 C++ Builder 文件”就足够了。

The problem turns out to be the search path of the linking package. It can not find the .DCP file, then it can not link. It seems to look for the DCP first, fail silently, then look for the compiled unit in question (extension .dcu) and then give the error on the DCU not the missing DCP.

The Project Options "Generate All C++ Builder Files" is enough, if your search path (dcu and dcp search, ) and include (.hpp) folders.

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