comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Problem referencing library file via project file
Date: Sat, 30 Apr 2011 10:34:41 +0200
Date: 2011-04-30T10:34:40+02:00	[thread overview]
Message-ID: <avg5n91tudn2.1omhe5aj82v7j.dlg@40tude.net> (raw)
In-Reply-To: iuydnbpLUswxWSbQnZ2dnUVZ8tydnZ2d@brightview.co.uk

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.

P.S. I would make this packaging policy for all Ada distributions.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-04-30  8:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-30  8:15 Problem referencing library file via project file Robert Matthews
2011-04-30  8:34 ` Dmitry A. Kazakov [this message]
2011-04-30  8:57   ` Robert Matthews
2011-04-30 21:36   ` Alex R. Mosteo
replies disabled

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