comp.lang.ada
 help / color / mirror / Atom feed
From: Jan Andres <J@nAndr.es>
Subject: Re: gnat executables
Date: Wed, 22 Feb 2012 19:29:57 +0000 (UTC)
Date: 2012-02-22T19:29:57+00:00	[thread overview]
Message-ID: <ji3fnl$thg$1@dont-email.me> (raw)
In-Reply-To: def15140-d154-4c69-ba7d-731d6703bbda@t30g2000vbx.googlegroups.com

On 2012-02-22, tonyg <tonythegair@gmail.com> wrote:
> On Feb 22, 4:01 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>> On Wed, 22 Feb 2012 07:31:29 -0800 (PST), tonyg wrote:
>> > Whenever I compile some code for a different PC , it asks me for the
>> > runtime libraries for gtk and some others. Is there a way I can link
>> > my executable so the functions used in these libraries are included in
>> > my executable ?
>>
>> You have to link to the static (object) libraries. Whether this would work
>> depends on whether the provider of the library allows static linkage or
>> not. The answer would depend on the target platform and the licensing
>> policy.
>>
>> --
>> Regards,
>> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de
>
> The librarys are all debian based, things like libgnadecommon and
> libgtk,
> I was really looking for the command to give to gnatmake, I know -
> static option links
> in the gnat runtime etc

If I understand you correctly you have two options:

1. Instead of -lfoo specify /full/path/to/libfoo.a

2. Something like: -largs -Wl,-Bstatic -lfoo -lbar -Wl,-Bdynamic

The latter will switch the linker to static mode, link in the libraries
you specify and then switch it back to dynamic linking for the rest of
the command line (i.e. the part that gets added automatically for the
GNAT runtime etc).

Note also that the latter will probably only work on systems that have
the GNU linker and you may have to replace -Bstatic and -Bdynamic by
something else on other (i.e. non-Linux) OSes.



  reply	other threads:[~2012-02-22 19:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 15:31 gnat executables tonyg
2012-02-22 16:01 ` Dmitry A. Kazakov
2012-02-22 16:14   ` tonyg
2012-02-22 19:29     ` Jan Andres [this message]
2012-02-22 20:21       ` Dmitry A. Kazakov
2012-02-23  3:38         ` John B. Matthews
2012-02-23  8:37           ` Simon Wright
2012-02-24 19:31 ` gnat executables for Gtk Ada Francois54
2012-03-20 12:47 ` gnat executables tonyg
replies disabled

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