我正在尝试使用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 \为什么它需要实际的正文文件?specs + .a文件还不够吗?我如何才能规避这个问题呢?
发布于 2011-05-04 04:42:55
规格和档案库是不够的。您需要指定.ali文件的位置。此外,请尝试使用-aI和-aL标志,而不是-I。
发布于 2011-05-04 04:41:02
您需要指定:
-largs switches:链接器开关,其中switches是gnatlink的有效开关列表。
-Ldir:将目录dir添加到链接器将在其中搜索库的目录列表。
例如,
-largs -L/lib/Linux/ndds.4.5d/lib/GNATgcc/static/debug -lnddsadad附录:您还可以查看
-Adir:相当于-aLdir -aIdir。
发布于 2011-05-05 14:28:12
您可以为该库创建一个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环境变量。
https://stackoverflow.com/questions/5873929
复制相似问题