Ada 编译问题(正在寻找我没有的 adb?)

发布于 2024-11-04 17:21:39 字数 1085 浏览 5 评论 0原文

我正在尝试使用 gnatmake 将第三方库编译到我现有的应用程序中。我收到此错误:

gnatmake: "dds.adb" not found
gnatmake: "dds-domainparticipant.adb" not found
gnatmake: "dds-domainparticipantfactory.adb" not found
gnatmake: "dds-publisher.adb" not found
gnatmake: "dds-topic.adb" not found
gnatmake: "dds-publisher_impl.adb" not found
gnatmake: "dds-datawriter_impl.adb" not found
gnatmake: "dds-domainparticipant_impl.adb" not found
gnatmake: "dds-readcondition_impl.adb" not found
gnatmake: "dds-datareader_impl.adb" not found
gnatmake: "dds-subscriber.adb" not found
gnatmake: "dds-condition.adb" not found
gnatmake: "dds-datareader.adb" not found
gnatmake: "dds-statuscondition.adb" not found

我将这些添加到构建 adp 的 gnatmake 中。 -I 包含所有规范(.ads 文件),libnddsadad 包含所有 o 文件:

       -I/lib/ndds.4.5d/include/ndds/dds_ada \
       -I/lib/ndds.4.5d/include/ndds/dds_ada/support     \
       -I/lib/ndds.4.5d/include/ndds/dds_ada/support/low-level \

       /lib/Linux/ndds.4.5d/lib/GNATgcc/static/debug/libnddsadad.a \

为什么它需要实际的正文文件?规格+ .a 文件还不够吗?我怎样才能规避这个问题?

I am trying to compile a third part library into my existing application using gnatmake.. And I am getting this error:

gnatmake: "dds.adb" not found
gnatmake: "dds-domainparticipant.adb" not found
gnatmake: "dds-domainparticipantfactory.adb" not found
gnatmake: "dds-publisher.adb" not found
gnatmake: "dds-topic.adb" not found
gnatmake: "dds-publisher_impl.adb" not found
gnatmake: "dds-datawriter_impl.adb" not found
gnatmake: "dds-domainparticipant_impl.adb" not found
gnatmake: "dds-readcondition_impl.adb" not found
gnatmake: "dds-datareader_impl.adb" not found
gnatmake: "dds-subscriber.adb" not found
gnatmake: "dds-condition.adb" not found
gnatmake: "dds-datareader.adb" not found
gnatmake: "dds-statuscondition.adb" not found

I added these to the gnatmake which builds the adp. The -I contains all of the specs (.ads files), and the libnddsadad has all of the o files:

       -I/lib/ndds.4.5d/include/ndds/dds_ada \
       -I/lib/ndds.4.5d/include/ndds/dds_ada/support     \
       -I/lib/ndds.4.5d/include/ndds/dds_ada/support/low-level \

       /lib/Linux/ndds.4.5d/lib/GNATgcc/static/debug/libnddsadad.a \

Why does it want the actual body files? Shouldn’t the specs + .a file be enough? How can I circumvent this?

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

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

发布评论

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

评论(3

满天都是小星星 2024-11-11 17:21:40

规格和档案库还不够。您需要指定 .ali 文件的位置。另外,尝试使用 -aI 和 -aL 标志而不是 -I。

Specs and an archive library are not enough. You need to specify the location of the .ali files. Also, try using the -aI and -aL flags instead of -I.

半衬遮猫 2024-11-11 17:21:40

您需要指定:

-largs 开关:链接器开关,其中 switches 是有效开关的开关列表gnatlink

-Ldir:将目录 dir 添加到链接器将在其中搜索库的目录列表中。

例如,

-largs -L/lib/Linux/ndds.4.5d/lib/GNATgcc/static/debug -lnddsadad

附录:您还可以查看

-Adir:相当于-aLdir -aIdir

You need to specify:

-largs switches: Linker switches, where switches is a list of switches that are valid switches for gnatlink.

-Ldir: Add directory dir to the list of directories in which the linker will search for libraries.

For example,

-largs -L/lib/Linux/ndds.4.5d/lib/GNATgcc/static/debug -lnddsadad

Addendum: You might also look at

-Adir: Equivalent to -aLdir -aIdir.

几味少女 2024-11-11 17:21:40

您可以为该库创建一个 gnat 项目文件,如下所示:

project DDS_Lib is
   for Source_Dirs use ("/usr/include/dds_path");
   for Library_Name use "nddsadad";
   for Library_Dir use "/usr/lib/dds_path";
   for Library_ALI_Dir use "/usr/lib/dds_ali_path";
   for Externally_Built use "true";
end DDS_Lib;

然后在项目文件中,在开头添加 with "dds_lib.gpr"; 。您不必向链接器标志添加任何内容即可与此库链接,因为它是自动完成的。

好的 Ada 库已经提供了这样的 gpr 文件,该文件应该安装在标准搜索路径(例如 /usr/lib/gnat/)中。如果安装在非标准路径,您可以将该路径添加到 ADA_PROJECT_PATH 环境变量中。

You could create a gnat project file for the library, something like this:

project DDS_Lib is
   for Source_Dirs use ("/usr/include/dds_path");
   for Library_Name use "nddsadad";
   for Library_Dir use "/usr/lib/dds_path";
   for Library_ALI_Dir use "/usr/lib/dds_ali_path";
   for Externally_Built use "true";
end DDS_Lib;

and then in your project file, add with "dds_lib.gpr"; at the beginning. You don't have to add anything to your Linker flags to link with this library, since it is done automagically.

Good Ada libraries already provide such a gpr file, which should get installed in the standard search path (for example /usr/lib/gnat/). If it is installed at a non-standard path, you can add the path to the ADA_PROJECT_PATH environment variable.

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