From: Bruce.Conroy@jpl.nasa.gov
Subject: Re: GNAT for NT Linking Problem
Date: 1996/09/10
Date: 1996-09-10T00:00:00+00:00 [thread overview]
Message-ID: <1996Sep10.171211.18345@llyene.jpl.nasa.gov> (raw)
In-Reply-To: 32342D50.1E1C@planet8.eag.unisysgsg.com
In <32342D50.1E1C@planet8.eag.unisysgsg.com>, Matt O'Hara
<mohara@planet8.eag.unisysgsg.com> writes:
>I'm in the process of porting a Solaris Ada program to the PC, using
>GNAT 304a for Windows NT (freshly ftp'd and installed). This Ada program
>uses the C libraries extensively (basic things, like fputc, fgetc, feof,
>toupper, etc).
>
>All the Ada code compiles correctly, yet when I try to link I am getting
>errors referencing some of these C libraries. For example, it cant find
>things like toupper or feof, yet it (evidently, based on the lack of
>error message) can find things like tolower and fputc. Considering that
>these routines should come from the same sets of libraries, it seems odd
>that the linker could find one thing but not the others.
>
>I had similar problems when I tried installing and using the GNAT 301a
>compiler.
>
>Any ideas?
The ones you can't find are the ones that are defined as macros in one
of the C header files rather than real code. Thus there is nothing in
the library to link in. It is very system dependent. The one I have
fought is "feof" which is a macro on OS/2, but compiled code on
Solaris.
my solution is shown in the following body definition:
function FEOF(HANDLE : HANDLE_TYPE) return integer;
pragma Import (C, FEOF
-- on some systems FEOF is a
-- macro. On these it is necessary
-- to compile the following program
-- #include <stdio.h>
--
-- int END_FILE (FILE *s)
-- {return (s->flags & _IOEOF ? 1: 0);}
-- then add the resuling object to either
-- the linker or one of the libraries,
-- and uncomment the following line
, "END_FILE"
);
Lots of luck.
Bruce
prev parent reply other threads:[~1996-09-10 0:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-09-09 0:00 GNAT for NT Linking Problem Matt O'Hara
1996-09-09 0:00 ` Tom Griest
1996-09-09 0:00 ` Jonas Nygren
1996-09-09 0:00 ` Michael Feldman
1996-09-23 0:00 ` Klaus Wyss
1996-09-23 0:00 ` Tom Griest
1996-09-24 0:00 ` Robert Dewar
1996-09-25 0:00 ` Matt O'Hara
1996-09-10 0:00 ` Bruce.Conroy [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox