From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: Upgrading GNAT GPS 5.0 -> 5.3 Date: Thu, 14 Aug 2014 19:15:51 +0300 Organization: Aioe.org NNTP Server Message-ID: References: <53ebbf4c$0$32613$862e30e2@ngroups.net> <3261a000-e171-4e03-b3ec-af1bc5cad9d7@googlegroups.com> <68fn1tyynoal.1la5dyi9o49z9$.dlg@40tude.net> <1oacgorukz06m.19lkc26ly0rts.dlg@40tude.net> NNTP-Posting-Host: AnnUDmZwVERVUXyHDyOl5A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:21761 Date: 2014-08-14T19:15:51+03:00 List-Id: Dmitry A. Kazakov wrote: > On Thu, 14 Aug 2014 18:59:48 +0300, Victor Porton wrote: > >> Dmitry A. Kazakov wrote: >> >>> On Thu, 14 Aug 2014 15:18:49 +0300, Victor Porton wrote: >>> >>>> Egil H H wrote: >>>> >>>>> On Wednesday, August 13, 2014 10:10:31 PM UTC+2, Victor Porton wrote: >>>>> >>>>>> package Linker is >>>>>> >>>>>> for Linker_Options use ("-lraptor2"); >>>>>> >>>>>> end Linker; >>>>>> >>>>> >>>>> From the GPRbuild User's Guide (emphasis mine): >>>>> Linker.Linker_Options: >>>>> This attribute specifies additional switches to be given to the linker >>>>> when linking an executable. >>>>> *It*is*ignored*when*defined*in*the*main*project* and taken into >>>>> account in all other projects that are imported directly or >>>>> indirectly. These switches complement the Linker.Switches defined in >>>>> the main project. This is useful when a particular subsystem depends >>>>> on an external library: adding this dependency as a Linker_Options in >>>>> the project of the subsystem is more convenient than adding it to all >>>>> the Linker.Switches of the main projects that depend upon this >>>>> subsystem. >>>> >>>> I don't understand. >>>> >>>> Does this mean that it's impossible to link a library to the main >>>> project?! >>> >>> It means that the option is intended for library projects not for the >>> client projects. >> >> 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", "-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. >> 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 don't understand you. -- Victor Porton - http://portonvictor.org