Question

I try to compile unit with ada-zlib. Package ada-zlib-dev is installed. In code I write with Ada.Text_IO;. GNAT Reference Manual states that additional compiler arguments are not required if library is located in directory from ADA_INCLUDE_PATH environment variable. But it's empty. How should I set that variable to get code compiled?


UPDATE:

The code is read.adb from zlib-ada. It's provided as an example. Command line:

gnatmake read.adb
Était-ce utile?

La solution

I found answer finally.

It isn't necessary to set environment variables. The .gpr files for the libraries are located in /usr/lib/gnat. You need to write such .gpr file for your project:

with "<name of lib's .gpr file related to /usr/lib/gnat";
project SUFO is
        for Source_Dirs use ("src");
        for Object_Dir use "obj";
        for Exec_Dir use "bin";
        for Main use ("src/main.adb");
end SUFO;

And run gprbuild command in project directory, where you've placed your .gpr file.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top