comp.lang.ada
 help / color / mirror / Atom feed
From: agent@drrob1.com
Subject: Re: texttools and standard library packages
Date: Sun, 15 Dec 2013 19:43:18 -0500
Date: 2013-12-15T19:43:18-05:00	[thread overview]
Message-ID: <dbhsa9tsa9hm5ilm4bh84htc3m2h998pbh@4ax.com> (raw)
In-Reply-To: b1sv5f9znc5x.1iutcm7icq3yd.dlg@40tude.net

On Thu, 12 Dec 2013 19:00:16 +0100, "Dmitry A. Kazakov"
<mailbox@dmitry-kazakov.de> wrote:

> On 13-12-12 14:34 , agent@drrob1.com wrote:
> So I decided to use uio_ and uio2_ programs.  These
> compiled.  But generated lots of linker unresolved symbol errors.  The
> commandline I used was:
> 
> gnatmake -g -gnatf -gnato -fstack-check -gnatVa -gnatwu -gnat2012 -lm \
> -lncurses
> 
> If you want to specify more (non-Ada) libraries to be linked into your
> Ada program, you should either use the pragma Linker_Options in the Ada
> source files or put the linker options in the gnatmake command _after_
> the gnatmake option -largs. At least, as I understand it.
>
>Or, much better, create an externally-built library project, e.g.
>
>project Curses is
>   for Externally_Built use "true";
>   for Source_Files use ();
>   for Library_Dir use "/usr/lib"; -- For example
>   for Library_Name use "ncurses";
>   for Library_Kind use "dynamic"; -- When linking to a shared library
>end Curses;
>
>and use it with your project.
>
>GNAT will do anything needed to link to the library. This includes adding
>messy prefixes like "lib" on Linux targets, choosing appropriate file type,
>*.dll, *.so, *.lib, *.a etc. Note also that this is transitive. If your
>project is itself a library project = may not have linker options by
>itself, a third project will nevertheless inherit linker options from
>Curses through it.
>
>[pragma Linker_Options is the worst of all three]


I appreciate the help a lot.  As a long-time modula-2 user, I
attempted to use gm2.  But I received NO help when I posted issues to
the mailinglist.  So I abandoned that and figured I'd try Ada and
getting help from here.

I attempted to follow the instructions regarding an externally-built
library project.  But I got hung up in not having any source for a
library project, and even if I could get this to compile, I do not
know how to use a library I built myself.  So I abandoned the project
approach.

But I was able to get the basic.adb example to run.  Oddly, it
complained that it needed libtinfo.so.5 and it actually told me where
it was.  To bad it could not then pull it in automatically since it
knew where it was.  But this line worked:

gnatmake -g -O2 basic.adb -largs system.o curses.o /lib/libtinfo.so.5
-lm -lncurses

I dumped everything into 1 directory so this worked.  Now I'll play a
little more

Thanks again


  reply	other threads:[~2013-12-16  0:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11  2:25 texttools and standard library packages agent
2013-12-11 12:48 ` Niklas Holsti
2013-12-12 12:34   ` agent
2013-12-12 17:44     ` Niklas Holsti
2013-12-12 18:00       ` Dmitry A. Kazakov
2013-12-16  0:43         ` agent [this message]
2013-12-16  1:11           ` Ludovic Brenta
2013-12-16  1:38             ` agent
2013-12-16  8:18           ` Dmitry A. Kazakov
2013-12-16  9:23             ` Simon Wright
2013-12-19  1:40               ` agent
2013-12-19  8:57                 ` Simon Wright
2013-12-19 12:59                   ` agent
2013-12-20  1:46                     ` agent
2013-12-15 22:05 ` koburtch
2013-12-22 19:24   ` koburtch
2013-12-27  0:35     ` agent
2014-01-03 21:38       ` Ludovic Brenta
2014-01-05 21:33         ` agent
2013-12-27  0:36     ` agent
replies disabled

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