[AWS] gnatlink fails with aws hello world example on debian 4.0

Andreas Schipplock andreas at schipplock.de
Wed Dec 3 19:21:19 CET 2008


Dear Ludovic Brenta,
Thanks for the quick help. I added the "package Linker..." part into
my "default.gpr" and it worked! But I still want to answer your
questions because there is still some inconsistency with what I found.

The output of "gnat ls -v -Pdefault.gpr" is : http://pastie.org/329936
The "/usr/share/ada/adainclude" path appears twice probably because I
defined ADA_PROJECT_PATH in my .bashrc .

The following packages related to "aws", "ada", "gnat" and "gcc" are
installed: http://pastie.org/329956

The lib "libaws.so" is in place and symlinked to the correct file:
http://pastie.org/329959
That's just fine I think.

I just searched for "aws.gpr" on my whole file system because you
wanted to let me check that I'm using the correct "aws.gpr" and
indeed, I found two versions of "aws.gpr".
One in "/usr/share/ada/adainclude" and another in "/usr/lib/gnat". But
the output of "gnat ls -v -Pdefault.gpr" is not referring to
"/usr/lib/gnat" at all so I'm wondering if the "aws.gpr" in
"/usr/lib/gnat" got ever touched or used...the "package Linker..."
part is in the "/usr/share/ada/adainclude/aws.gpr" and not in the
"/usr/lib/gnat/aws.gpr". I expected it to be missing in the
"/usr/share/ada/adainclude/aws.gpr" like you but I was wrong.

The output of "gnatmake -v -Pdefault.gpr > bla.log 2>&1" :
http://pastie.org/329977

This is my "/usr/share/ada/adainclude/aws.gpr": http://pastie.org/329946
This is my "/usr/lib/gnat/aws.gpr": http://pastie.org/329954

My project file "default.gpr" now looks like this: http://pastie.org/329989
And it compiles fine with "gnatmake -Pdefault.gpr".

Thanks :).
-
Kind regards,
Andreas Schipplock.

On Wed, Dec 3, 2008 at 4:54 PM, Ludovic Brenta
<ludovic at ludovic-brenta.org> wrote:
> Selon Andreas Schipplock:
>> Hi,
>> I'm using Debian 4.0 "Etch" and I installed the following packages:
>> gnat and libaws-dev
>>
>> Consider the following example that I copied from the documentation:
>> http://pastie.org/329687
>> I created the following project file "default.gpr":
>> http://pastie.org/329693
>> I am compiling this with: "gnatmake -Pdefault.gpr"
>> I am getting the following gnatlink error: http://pastie.org/329697
>>
>> If I compile a simple hello world, it's working just fine as expected:
>> http://pastie.org/329688
>>
>> I have no idea what's going wrong here. If you could give me a hand, I
>> would be happy :).
>
> It looks like gnatmake forgets to link your program with
> /usr/lib/libaws.so.
>
> Theoretically, this is how it should work: your project file does a "with
> "aws"" which loads /usr/share/ada/adainclude/aws.gpr. This file contains
> a stanza like this:
>
> package Linker is
>   for Default_Switches ("Ada") use ("-laws");
> end Linker;
>
> which causes gnatmake to link your program with /usr/lib/libaws.so
> (provided by package libaws-dev), which is a symbolic link to
> /usr/lib/libaws.so.2.2 (provided by package libaws2.2), which is the real
> shared library.
>
> Apparently, this scenario is broken somewhere on your machine. Please make
> sure:
>
> - which aws.gpr you actually use (e.g. "gnat ls -v -Pdefault.gpr")
> - that both packages libaws-dev and libaws2.2 are installed
> - that both the symbolic link and the shared library are present
>
> Also, the output of "gnatmake -v -Pdefault.gpr" might be useful.
>
> HTH
>
> --
> Ludovic Brenta.
>


More information about the AWS mailing list