Ada:gnat gprbuild如何在库中链接? [英] Ada: gnat gprbuild How to link in libraries?

查看:84
本文介绍了Ada:gnat gprbuild如何在库中链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我正在研究的多语言GPRBuild项目中,我有一些c ++库文件(* .a)需要链接到我的可执行文件中。

In this multi-language GPRBuild project I'm working on, I have some c++ library files (*.a) I need to link into my executable. Is there an gpr attribute to tell it what to link in or anyway to pass -l -L switches to the linker?

推荐答案

是否有gpr属性来告诉它要链接的内容还是通过-l -L切换到链接器?甚至更好:

Or even better:

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;

And in the application project. With "my_library.gpr";

这篇关于Ada:gnat gprbuild如何在库中链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆