comp.lang.ada
 help / color / mirror / Atom feed
* Using GNAT project files and libraries
@ 2008-03-07 22:37 Maciej Sobczak
  2008-03-08 11:59 ` Tero Koskinen
  2008-03-08 17:33 ` Simon Wright
  0 siblings, 2 replies; 7+ messages in thread
From: Maciej Sobczak @ 2008-03-07 22:37 UTC (permalink / raw)


Hi,

I have a library composed of two packages: the root library package,
which is empty (pure), and one child containing Some_Procedure. Let's
say the packages are named L and L.Child. The library is compiled and
resides in the following directories:

src: l.ads, l-child.ads, l-child.adb
lib: l.ali, l-child.ali, libl.a

There is also a sibling test directory with the following a.adb:

with L.Child;
procedure A is
begin
   L.Child.Some_Procedure;
end A;

Now I try to figure out how to write A.gpr project file.
I have the following:

project A is

    for Source_Files use ("a.adb");

    package Compiler is
        for Default_Switches ("Ada") use ("-I../src");
    end Compiler;

end A;

This is enough to get the a.adb file compiled, but after that gnatmake
exits with:

gnatmake: "l.ads" not found

I tried similar entries for Binder and Builder packages (with
different combinations of -aI, -aL, -aO, etc.), but to no avail.

How should I write the complete A.gpr project file so that my a.adb
can use the L library?

Note that the following:

$ gnatmake a -I../src -L../lib -largs -ll

creates a working executable, but does *not* do it the way I want - it
seems to compile ../src/l-child.adb, which I guess can be avoided
(the ../lib/libl.a has some purpose, after all).

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-03-09 19:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-07 22:37 Using GNAT project files and libraries Maciej Sobczak
2008-03-08 11:59 ` Tero Koskinen
2008-03-08 17:33 ` Simon Wright
2008-03-08 20:46   ` Maciej Sobczak
2008-03-08 22:17     ` Simon Wright
2008-03-09 13:15       ` Maciej Sobczak
2008-03-09 19:03         ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox