From: Victor Porton <porton@narod.ru>
Subject: Re: Upgrading GNAT GPS 5.0 -> 5.3
Date: Thu, 14 Aug 2014 20:18:34 +0300
Date: 2014-08-14T20:18:34+03:00 [thread overview]
Message-ID: <lsir16$248$1@speranza.aioe.org> (raw)
In-Reply-To: ly7g2bkodj.fsf@pushface.org
Simon Wright wrote:
> Victor Porton <porton@narod.ru> writes:
>
>> Dmitry A. Kazakov wrote:
>>
>>> On Thu, 14 Aug 2014 18:59:48 +0300, Victor Porton wrote:
>
>>>> But if I wanted to add linker option -lraptor2 to a non-library
>>>> project, what I would need to do?
>>>
>>> You never need that for a library. However, you were already answered in
>>> this thread how to do this:
>>>
>>> project Messy_Client is
>>> ...
>>> package Linker is
>>> for Default_Switches ("ada") use ("-L<some-path>", "-lraptor2");
>>> end Linker;
>>>
>>> end Messy_Client;
>>
>> In GNAT GPS 5.3 this works only if Messy_Client is a library project (and
>> with Linker_Options instead of Default_Switches).
>>
>> IN GNAT 5.0 it worked for non-library projects also.
>>
>> It looks like a bug in GNAT GPS 5.3.
>
> Could you please run
> gprbuild --version
> on the command line and tell us the version it reports.
>
> For example, here I get
>
> $ gprbuild --version
> GPRBUILD GPL 2014 (20140331) (x86_64-apple-darwin13)
$ gprbuild --version
GPRBUILD 2014 (unknown) (i486-pc-linux-gnu)
Copyright (C) 2004-2014, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
> and I added
>
> package Linker is
> for Default_Switches ("ada") use ("-lraptor2");
> end Linker;
>
> to an existing non-library project. I don't have libraptor2, so this
> failed to link, but the switch was copied through correctly:
>
> gcc test-main.o -lraptor2 -L/usr/lib -ltk8.5 -ltcl8.5 -o test-main
> ld: library not found for -lraptor2
>
>>>> Many non-library projects need to link to libraries.
>>>
>>> They should *always* use library projects instead of linking directly to
>>> external libraries.
>>
>> Why?!
>>
>> It is completely legit for a non-library project to link to a C
>> library directly to obtain some functionality from a C library.
>
> I think Dmitry means that you will find things easier if you use library
> projects for external libraries.
--
Victor Porton - http://portonvictor.org
next prev parent reply other threads:[~2014-08-14 17:18 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-13 17:50 Upgrading GNAT GPS 5.0 -> 5.3 Victor Porton
2014-08-13 19:17 ` Victor Porton
2014-08-13 19:28 ` Simon Wright
2014-08-13 19:33 ` Victor Porton
2014-08-13 19:41 ` Per Sandberg
2014-08-13 20:10 ` Victor Porton
2014-08-13 20:29 ` Björn Lundin
2014-08-13 20:36 ` Victor Porton
2014-08-13 22:36 ` Björn Lundin
2014-08-14 12:03 ` Victor Porton
2014-08-14 7:19 ` Egil H H
2014-08-14 7:32 ` Simon Wright
2014-08-14 8:00 ` Dmitry A. Kazakov
2014-08-14 12:14 ` Victor Porton
2014-08-14 12:18 ` Victor Porton
2014-08-14 15:56 ` Dmitry A. Kazakov
2014-08-14 15:59 ` Victor Porton
2014-08-14 16:09 ` Dmitry A. Kazakov
2014-08-14 16:15 ` Victor Porton
2014-08-14 16:49 ` Simon Wright
2014-08-14 17:18 ` Victor Porton [this message]
2014-08-14 17:22 ` Dmitry A. Kazakov
2014-08-14 17:27 ` Victor Porton
2014-08-14 17:32 ` Simon Wright
2014-08-14 17:43 ` Victor Porton
2014-08-14 20:03 ` Dmitry A. Kazakov
2014-08-14 20:27 ` Victor Porton
2014-08-15 7:00 ` Dmitry A. Kazakov
2014-08-15 12:06 ` porton.victor
2014-08-16 11:53 ` Stephen Leake
2014-08-15 6:36 ` Simon Wright
2014-08-14 20:50 ` Simon Wright
2014-08-15 12:07 ` porton.victor
2014-08-16 11:55 ` Stephen Leake
2014-08-16 16:11 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox