comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Help Linking Shared Objects for Library Use
Date: Sat, 28 Apr 2018 21:32:30 +0100
Date: 2018-04-28T21:32:30+01:00	[thread overview]
Message-ID: <lylgd7ax7l.fsf@pushface.org> (raw)
In-Reply-To: a30c613f-e25a-43e1-9ee2-315baade3bbb@googlegroups.com

patrick@spellingbeewinnars.org writes:

> gnatmake barn.adb -lsounds
> gcc-4.6 -c -lsounds barn.adb
> gcc-4.6 -c -lsounds cow.ads
> gnatbind -x barn.ali
> gnatlink barn.ali
> ./barn.o: In function `_ada_barn':
> barn.adb:(.text+0x9): undefined reference to `moo'
> collect2: ld returned 1 exit status
> gnatlink: error when calling /usr/bin/gcc-4.6
> gnatmake: *** link failed.
>  
> When I look at the Ada library code installed from my repo it has .ali
> files but I don't think I am generating cow.ali

Well, are you or aren't you? is it there or not?

> Is there a step I am missing to build cow.ads properly? or am I doing
> something else wrong?

You might have thought that gnatmake would report that it's going to
ignore that '-lsounds' at the link phase, after uselessly passing it
through to the compile phase. Interestingly, it does recognise that -L
only needs to be passed through to the link phase.

The answer is to say

   $ gnatmake barn.adb -largs -lsounds

> Thanks for reading-Patrick

I very nearly didn't, because of the careless formatting of the code.

  reply	other threads:[~2018-04-28 20:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28 19:07 Help Linking Shared Objects for Library Use patrick
2018-04-28 20:32 ` Simon Wright [this message]
2018-04-28 21:01   ` patrick
replies disabled

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