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 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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Upgrading GNAT GPS 5.0 -> 5.3 Date: Thu, 14 Aug 2014 17:49:28 +0100 Organization: A noiseless patient Spider 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="b814ca014269fd1fa21bc4c05b94dd9e"; logging-data="21717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DyG1r8UHZ9oNIB4GxWVqXzHR/MIxbC4E=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:VH25uqWBHfrEE5Ulv2CrSo9TJP4= sha1:Q8p0vCmWNF9bu5LL0lOwKksWH3U= Xref: news.eternal-september.org comp.lang.ada:21763 Date: 2014-08-14T17:49:28+01:00 List-Id: Victor Porton 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", "-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) 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.