问题
Im using gnat4.6 on Ubuntu installed using apt-get. I need to know where to install downloaded libraries like APQ. What should I set my ADA_INCLUDE_PATH
and ADA_OBJECTS_PATH
to?
回答1:
The beauty of Ada support in Debian (on which Ubuntu is based) is that you don't need to mess with ADA_INCLUDE_PATH
and friends; supported libraries are installed where the GNAT Project Manager expects to find them. Say gnatls -v
to see the default values.
To use the system as intended, you will find it much simpler to use the GNAT Project Manager; you'd say, in your my_project.gpr
file,
with "apq";
project My_Project is
...
and build with
$ gnatmake -P my_project
There's online documentation for GPR, but I wouldn't call it particularly user-friendly. There's a set of Youtube videos (I haven't looked at them in any detail; their stated interest is large systems, but hang in there).
回答2:
I use gnatmake to build; how do I cite my build paths in a correct way?
The relevant options are shown in 6.2 Switches for gnatmake: Source and library search path switches.
Addendum: The development package is libapq3.2.0-dev
.
The manual is in
/usr/share/doc/libapq3.2.0-dev/manual.pdf.gz
An example and corresponding
.gpr
file are in/usr/share/doc/libapq3.2.0-dev/examples
. As @Simon suggested, the.gpr
file begins:with "apq.gpr"; project APQ.Samples is
The Ada include files are in
/usr/share/ada/adainclude/apq
.The libraries are in
/usr/lib
.
$ dpkg -L libapq3.2.0-dev /. /usr /usr/share /usr/share/ada /usr/share/ada/adainclude /usr/share/ada/adainclude/apq /usr/share/ada/adainclude/apq/apq_helper.ads /usr/share/ada/adainclude/apq/apq_helper.adb /usr/share/ada/adainclude/apq/apq.adb /usr/share/ada/adainclude/apq/apq.ads /usr/share/ada/adainclude/apq.gpr /usr/share/doc /usr/share/doc/libapq3.2.0-dev /usr/share/doc/libapq3.2.0-dev/copyright /usr/share/doc/libapq3.2.0-dev/manual.pdf.gz /usr/share/doc/libapq3.2.0-dev/examples /usr/share/doc/libapq3.2.0-dev/examples/apq-samples.adb /usr/share/doc/libapq3.2.0-dev/examples/apq-samples.ads /usr/share/doc/libapq3.2.0-dev/examples/apq-samples.gpr /usr/lib /usr/lib/libapq.a /usr/lib/ada /usr/lib/ada/adalib /usr/lib/ada/adalib/apq /usr/lib/ada/adalib/apq/apq_helper.ali /usr/lib/ada/adalib/apq/apq.ali /usr/share/doc/libapq3.2.0-dev/changelog.Debian.gz /usr/lib/libapq.so
来源:https://stackoverflow.com/questions/14643609/what-is-the-standard-ada-include-path