comp.lang.ada
 help / color / mirror / Atom feed
* can Ada be linked dynamically ??
@ 2002-01-10 14:45 Marc Neininger
  2002-01-10 15:27 ` Mark Johnson
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Neininger @ 2002-01-10 14:45 UTC (permalink / raw)


Hi NG,

can I link an Ada program dynamically??

Marc



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can Ada be linked dynamically ??
  2002-01-10 14:45 can Ada be linked dynamically ?? Marc Neininger
@ 2002-01-10 15:27 ` Mark Johnson
  2002-01-10 19:29   ` Marc Neininger
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Johnson @ 2002-01-10 15:27 UTC (permalink / raw)


Marc Neininger wrote:
> 
> Hi NG,
> 
> can I link an Ada program dynamically??
> 
> Marc

Yes, No, Maybe. It depends on which system you are using.

You need to be a LOT more specific on which target system, which
compiler, and other relevant information before anyone can give you a
helpful reply. I also assume you really want to know "HOW" to do this,
not just can it be done.
  --Mark



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can Ada be linked dynamically ??
  2002-01-10 15:27 ` Mark Johnson
@ 2002-01-10 19:29   ` Marc Neininger
  2002-01-10 23:28     ` Mark Johnson
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Neininger @ 2002-01-10 19:29 UTC (permalink / raw)


> Yes, No, Maybe. It depends on which system you are using.
I'm using LINUX with the normal gnat compiler

> You need to be a LOT more specific on which target system, which
> compiler, and other relevant information before anyone can give you a
> helpful reply. I also assume you really want to know "HOW" to do this,
> not just can it be done.

... Thanx for this fast answer. So generally spoken it is possible.
Target systems would be Windows and Linux.

We are using typically gnat on Linux and Adagide on Windows (think it
also works with the gnat compiler).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can Ada be linked dynamically ??
  2002-01-10 19:29   ` Marc Neininger
@ 2002-01-10 23:28     ` Mark Johnson
  2002-01-11  7:06       ` Marc Franz Neininger
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Johnson @ 2002-01-10 23:28 UTC (permalink / raw)


Marc Neininger wrote:
> 
> > Yes, No, Maybe. It depends on which system you are using.
> I'm using LINUX with the normal gnat compiler
> 
> > You need to be a LOT more specific on which target system, which
> > compiler, and other relevant information before anyone can give you a
> > helpful reply. I also assume you really want to know "HOW" to do this,
> > not just can it be done.
> 
> ... Thanx for this fast answer. So generally spoken it is possible.
> Target systems would be Windows and Linux.
> 
> We are using typically gnat on Linux and Adagide on Windows (think it
> also works with the gnat compiler).

From the GNAT user's guide (assuming Linux)...

... For simple libraries, it is also possible to create a dummy main
program which depends upon all the packages that comprise the interface
of the library. This dummy main program can then be given to gnatmake,
in order to build all the necessary objects.

[dummy program not included]

gnatmake -c my_lib_dummy.adb
rm my_lib_dummy.o my_lib_dummy.ali
ar rc libmy_lib.a *.o
gcc -shared -o libmy_lib.so *.o

to generate both the static and dynamic library for the packages
referenced by "my_lib_dummy". I assume you know how to refer to a
separate library in linking.

In addition, to use the library, you need to provide the following
source files...
 - the specs of all packages that make up the visible part of the
library
 - all sources upon which the visible parts depend
 - the bodies of all visible generic units
For example, if you use pragma Inline for a function, you must provide
the body for that function. It is recommended (but not mandatory) to
include ALL source files used in the library - to aid the user in
debugging.

The user's guide has more details and other examples. I can't comment on
the same steps on Windows; perhaps someone else can.
  --Mark



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can Ada be linked dynamically ??
  2002-01-10 23:28     ` Mark Johnson
@ 2002-01-11  7:06       ` Marc Franz Neininger
  2002-01-13 15:47         ` David Botton
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Franz Neininger @ 2002-01-11  7:06 UTC (permalink / raw)


Thanx for this answer. It helped a lot.

And have a nice weekend

Marc




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: can Ada be linked dynamically ??
  2002-01-11  7:06       ` Marc Franz Neininger
@ 2002-01-13 15:47         ` David Botton
  0 siblings, 0 replies; 6+ messages in thread
From: David Botton @ 2002-01-13 15:47 UTC (permalink / raw)


On Windows, it is possible to create a DLL, but the preferred method (for
all languages) is as a COM object. This is very easily done using GNATCOM
(http://www.adapower.com/gnatcom). That COM object can then be loaded in to
your App using the Inproc version for the same performance as any
dynamically loaded DLL.

David Botton




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-01-13 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-10 14:45 can Ada be linked dynamically ?? Marc Neininger
2002-01-10 15:27 ` Mark Johnson
2002-01-10 19:29   ` Marc Neininger
2002-01-10 23:28     ` Mark Johnson
2002-01-11  7:06       ` Marc Franz Neininger
2002-01-13 15:47         ` David Botton

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