在我正在处理的这个多语言 GPRBuild 项目中,我有一些 c++ 库文件 (*.a) 我需要链接到我的可执行文件中。是否有一个 gpr 属性告诉它要链接什么或无论如何将 -l -L 开关传递给链接器?
问问题
5662 次
2 回答
9
甚至更好:
Project my_library is
For externally_built use "true";
For library_dir use "/where/ever";
For library_name use "mylibname";
For source_dirs use (); -- no sources.
For library_kind use "static";
-- if it is a static lib .a
-- for library_kind use "dynamic";
-- if it is an so.
End my_library;
并在应用项目中。使用“my_library.gpr”;
于 2014-06-11T15:32:19.827 回答
8
在主项目文件中,
package Linker is
for Default_Switches ("Ada") use ("-L/where/ever", "-lbar");
end Linker;
于 2012-09-17T23:00:22.317 回答