正向类型未解决-Lazarus freepascal

发布于 2025-01-28 17:34:11 字数 380 浏览 2 评论 0原文

我正在尝试使用以前从C成功使用的Pascal的外部库。为了使用此库,我已经提供了一个.h文件,一个.dll文件和.lib文件。

我使用H2PAS实用程序转换了.H文件,但是我遇到了以下错误(我怀疑与链接器有关):

Error: (5009) Forward type not resolved "XPRSbranchobject"

这似乎是有问题的行:

type
    ...
    XPRSbranchobject = ^xo_user_branch_entity_s ; 

我如何让Lazarus知道xo_user_branch_entity_s是外部库的一部分吗?

I am trying to use an external library from Pascal that I have successfully used from C before. In order to use this library I have been provided a .h file, a .dll file and a .lib file.

I converted the .h file using the h2pas utility but I am getting the following errors (which I suspect are linker-related):

Error: (5009) Forward type not resolved "XPRSbranchobject"

This appears to be the offending line:

type
    ...
    XPRSbranchobject = ^xo_user_branch_entity_s ; 

How do I let Lazarus know that xo_user_branch_entity_s is part of the external library?

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

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

发布评论

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

评论(1

回忆躺在深渊里 2025-02-04 17:34:11

您可以简单地写:

type
  xo_user_branch_entity_s = record
    a: integer;     // <-- probably redundant
  end;
  XPRSbranchobject = ^xo_user_branch_entity_s;

您必须确定您永远不会(DE)分配此对象(直接或通过指针);如果消息来源试图访问内部成员,则编译器将抱怨。

这意味着分配/交易是由DLL完成的。

它应该(可以吗?)工作...

You could simply write:

type
  xo_user_branch_entity_s = record
    a: integer;     // <-- probably redundant
  end;
  XPRSbranchobject = ^xo_user_branch_entity_s;

You must be sure you never (de)allocate such object (the record, either directly or via pointer); if the sources tries to access internal members, the compiler will complain.

This implies that allocation/deallocation is done by the DLL.

It should (could?) work...

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