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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f0bea306882c2a15 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Problem referencing library file via project file Followup-To: comp.lang.ada Date: Sat, 30 Apr 2011 23:36:18 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Sat, 30 Apr 2011 21:36:23 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="GE1qkKi7N8YRsc1w8M9Vdw"; logging-data="13975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nnCUuM3VGTnygbKEs60xm" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:llekjGdDUuikXLVYpU0EAr2OvTY= Xref: g2news2.google.com comp.lang.ada:20076 Date: 2011-04-30T23:36:18+02:00 List-Id: Dmitry A. Kazakov wrote: > On Sat, 30 Apr 2011 09:15:34 +0100, Robert Matthews wrote: > >> I am trying to link the webkit library file with my program. >> One way that works is to use: >> >> pragma Linker_Options ("-lwebkit-1.0"); >> >> in my source file. >> >> However I would like to specify this in the program's >> project file. I have tried: >> >> package Linker is >> for Default_Switches ("ada") use ("-lwebkit-1.0"); >> end Linker; >> >> but this seems to be ignored - I just get undefined >> reference messages from gnatlink. Please help! > > I would recommend always refer external non-Ada libraries as proper > library projects rather than a bunch of linker options. > > In your case it could be: > > webkit.gpr: > --------------------------------------------------- > project WebKit is > for Externally_Built use "true"; > for Source_Files use (); > for Library_Dir use "/usr/lib"; -- Or whatever location it has > for Library_Name use "webkit-1.0"; > for Library_Kind use "dynamic"; > end WebKit; > ------------------------------------------------- > and then in your project you just "with" it: > > with "webkit.gpr"; > > Gprbuild and gprmake would do the rest. Thanks, that's a nice and clean solution. My experiences with Linker'Linker_Options and Linker'Switches have shown some inconsistencies over time that I didn't know how to solve in an elegant way, which I guess this will do. Alex. > > P.S. I would make this packaging policy for all Ada distributions. >