comp.lang.ada
 help / color / mirror / Atom feed
From: Sebastien <seb.morand@gmail.com>
Subject: Re: Shared library in Ada
Date: Sat, 19 Apr 2008 13:51:31 +0200
Date: 2008-04-19T13:51:31+02:00	[thread overview]
Message-ID: <fucmbu$5mm$1@registered.motzarella.org> (raw)
In-Reply-To: <4809da5c$0$625$9b4e6d93@newsspool1.arcor-online.net>

> I suppose you are referring to dynamic linking at the OS level?

Yes I am.

> In this case you need to import functions from the library, perhaps
> using pragma Import. Also, have a look at descriptions of the Ada
> package hierarchy "Interfaces"

But it's for interfacing with other languages, isn't it?
The point is I don't want to interface with some other language, I want 
to create Shared object in Ada and then link with this shared object

> The imported functions will have to match subprogram declarations
> in your package mylibpkg.

So you mean that if I use the pragma export in my ads file, everything 
is going to be fine?

For instance:
function My_Ada_Function return Integer is begin
   return 1;
end My_Ada_Function;
pragma Export
(Convention    => C,
  Entity        => My_Ada_Function,
  External_Name => "My_Ada_Function" );

Or will I have to get two ads file? One with the pragma Export to create 
the shared object, and then one with the Pragma import to use the shared 
object in my program?

> The documentation that came with your compiler should explain
> the switches needed for linking with shared libraries.

Yes I think I can find out by myself especially because I'm using gnat ;-)

Sebastien




  reply	other threads:[~2008-04-19 11:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-19 11:27 Shared library in Ada Sebastien
2008-04-19 11:41 ` Georg Bauhaus
2008-04-19 11:51   ` Sebastien [this message]
2008-04-19 15:31     ` Robert A Duff
2008-04-19 11:52 ` Ludovic Brenta
2008-04-19 11:55   ` Sebastien
2008-04-19 12:47     ` Sebastien
2008-04-19 13:39       ` Ludovic Brenta
2008-04-21 10:09         ` Sébastien
replies disabled

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