comp.lang.ada
 help / color / mirror / Atom feed
* Re: linking C library functions in Ada DOS .EXE
  1996-04-29  0:00 linking C library functions in Ada DOS .EXE ricardo
@ 1996-04-29  0:00 ` Samuel Tardieu
  1996-04-29  0:00 ` Jerry van Dijk
  1 sibling, 0 replies; 5+ messages in thread
From: Samuel Tardieu @ 1996-04-29  0:00 UTC (permalink / raw)
  To: ricardo


>>>>> "Ricardo" == ricardo  <ricardo@eucmax.sim.ucm.es> writes:

Ricardo> How can I tell gnatbind (or gcc, I'm not sure which of both)
Ricardo> to include the C library functions when calling C?

This is quite simple: in the package which defines the interface with
the C functions, just add a:

  pragma Linker_Options ("-lmylib");

and this should do the job.

Ricardo> The GNAT version I'm using is 2.06 for DOS. Thanks in
Ricardo> advance.

You may want to get a newer release by anonymous FTP. I don't know if
there is a mirror in Spain, but you can get it from France
(ftp://ftp.ibp.fr/pub/gnat/). 

  Sam
-- 
"La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette"
                                                       Charles Baudelaire




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

* Re: linking C library functions in Ada DOS .EXE
  1996-04-29  0:00 linking C library functions in Ada DOS .EXE ricardo
  1996-04-29  0:00 ` Samuel Tardieu
@ 1996-04-29  0:00 ` Jerry van Dijk
  1996-05-01  0:00   ` Michael Feldman
  1 sibling, 1 reply; 5+ messages in thread
From: Jerry van Dijk @ 1996-04-29  0:00 UTC (permalink / raw)



ricardo@eucmax.sim.ucm.es wrote:

: but when I run gnatbind I get a message that states that int86, inportw
: and outportw functions are not found.

These functions are in a separate PC library, not supprisingly called libpc.
use -lpc to add them.

However, be aware that the int86 functions in djgpp V1.X do not support all
possible calls, and might not be portable to the newer dpmi enviroment.
Use _dpmi_simulate_int() to be on the safe side. See my VGA package (probably
still to be found at ftp.gwu.edu in the EZ2LOAD directory) for examples.

: The GNAT version I'm using is 2.06 for DOS. Thanks in advance.

At the same place you will find newer versions of GNAT for DOS. V3.03 is
current and is really /much/ better then 2.06. 

Jerry.
-- 
-----------------------------------------------------------------------
--  Jerry van Dijk       --   e-mail: jerry@jvdsys.nextjk.stuyts.nl  --
--  Banking Consultant   --              Member Team-Ada             -- 
--  Ordina Finance BV    --    Located at Haarlem, The Netherlands   --




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

* linking C library functions in Ada DOS .EXE
@ 1996-04-29  0:00 ricardo
  1996-04-29  0:00 ` Samuel Tardieu
  1996-04-29  0:00 ` Jerry van Dijk
  0 siblings, 2 replies; 5+ messages in thread
From: ricardo @ 1996-04-29  0:00 UTC (permalink / raw)



        Hello, I'm writing a program that accesses to Video RAM in PC,
and I have a problem when linking some C routines with the Ada main
program. The problem is that to get access to PC I/O ports and BIOS
functions I have written three functions in C which I use as gateways
between Ada and system level. Both of C and Ada programs compile right,
but when I run gnatbind I get a message that states that int86, inportw
and outportw functions are not found. My question is:

How can I tell gnatbind (or gcc, I'm not sure which of both) to include
    the C library functions when calling C?

The GNAT version I'm using is 2.06 for DOS. Thanks in advance.

                                                Ricardo Palomares.




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

* Re: linking C library functions in Ada DOS .EXE
  1996-04-29  0:00 ` Jerry van Dijk
@ 1996-05-01  0:00   ` Michael Feldman
  1996-05-02  0:00     ` Jerry van Dijk
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Feldman @ 1996-05-01  0:00 UTC (permalink / raw)



In article <DqnCwu.69@jvdsys.nextjk.stuyts.nl>,
Jerry van Dijk <jerry@jvdsys.nextjk.stuyts.nl> wrote:

>However, be aware that the int86 functions in djgpp V1.X do not support all
>possible calls, and might not be portable to the newer dpmi enviroment.
>Use _dpmi_simulate_int() to be on the safe side. See my VGA package (probably
>still to be found at ftp.gwu.edu in the EZ2LOAD directory) for examples.

Yes, it's there and is a VERY nice piece of work! The full path is

ftp.gwu.edu/pub/ada/ez2load
>
>: The GNAT version I'm using is 2.06 for DOS. Thanks in advance.
>
>At the same place you will find newer versions of GNAT for DOS. V3.03 is
>current and is really /much/ better then 2.06. 

Well, actually we're distributing 3.01 as part of ez2load. 
3.03 is available at cs.nyu.edu/pub/gnat - I did not realize it
was there till very recently.

I've been testing a version of 3.03 compiled for djgpp version 2,
which also supports tasking. Currently this is a sort of "beta",
not-quite-fully-integrated. We've been discussing with ACT whether
to release this 3.03. They'd prefer to wait for 3.04, because
two distinct, and very different, 3.03's would be confusing.

If 3.04 comes out real soon, it makes sense to wait, I think.
Otherwise we may put out the 3.03. We are in close touch with the 
ACT-ers on this.

We're not quite ready in any case, because we're still exploring
the interactions between the new DJGPP environment and AdaCAPS.
There are a few things we don;t quite understand yet. 

Once we release, whether 3.03 or 3.04, it will be a really nice
GNAT plus a nice new version of AdaCAPS and some other goodies.
I'm quite pleased with the tasking.

I hate to be in the "Real Soon Now" state, but I guess it was
inevitable...

BTW - Jerry's VGA package compiles right up and runs nicely under
the new version, too.:-)

Mike Feldman




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

* Re: linking C library functions in Ada DOS .EXE
  1996-05-01  0:00   ` Michael Feldman
@ 1996-05-02  0:00     ` Jerry van Dijk
  0 siblings, 0 replies; 5+ messages in thread
From: Jerry van Dijk @ 1996-05-02  0:00 UTC (permalink / raw)



Michael Feldman (mfeldman@seas.gwu.edu) wrote:

: Well, actually we're distributing 3.01 as part of ez2load. 
: 3.03 is available at cs.nyu.edu/pub/gnat - I did not realize it
: was there till very recently.

Oops, that is what you get if you are in a hurry, sorry.

Though note that the 3.03 at cs.nyu.edu can be "dropped" into EZ2LOAD
and installs without problems.

: I've been testing a version of 3.03 compiled for djgpp version 2,
: which also supports tasking. Currently this is a sort of "beta",
: not-quite-fully-integrated. We've been discussing with ACT whether
: to release this 3.03. They'd prefer to wait for 3.04, because
: two distinct, and very different, 3.03's would be confusing.

I tend to agree. Getting a djgpp V2 version is important (I might then
stand a change of getting the forest POSIX binding running) but getting
tasking is even more so.

As soon as this "complete" Ada95 for DOS system is available, I am
planning on distributing it within the company. As it so happens, we
have been hiring a lot of ex-Fokker people among which a number of
experienced Ada programmers. And as a lack of experienced people within
the company has always been cited as the premier reason not to use
Ada...

-- 
-----------------------------------------------------------------------
--  Jerry van Dijk       --   e-mail: jerry@jvdsys.nextjk.stuyts.nl  --
--  Banking Consultant   --              Member Team-Ada             -- 
--  Ordina Finance BV    --    Located at Haarlem, The Netherlands   --




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

end of thread, other threads:[~1996-05-02  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-29  0:00 linking C library functions in Ada DOS .EXE ricardo
1996-04-29  0:00 ` Samuel Tardieu
1996-04-29  0:00 ` Jerry van Dijk
1996-05-01  0:00   ` Michael Feldman
1996-05-02  0:00     ` Jerry van Dijk

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