From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bb3c718a1fb5b85c X-Google-Attributes: gid103376,public From: Bruce.Conroy@jpl.nasa.gov Subject: Re: GNAT for NT Linking Problem Date: 1996/09/10 Message-ID: <1996Sep10.171211.18345@llyene.jpl.nasa.gov>#1/1 X-Deja-AN: 179745849 sender: news@llyene.jpl.nasa.gov references: <32342D50.1E1C@planet8.eag.unisysgsg.com> organization: Jet Propulsion Laboratory reply-to: Bruce.Conroy@jpl.nasa.gov newsgroups: comp.lang.ada Date: 1996-09-10T00:00:00+00:00 List-Id: In <32342D50.1E1C@planet8.eag.unisysgsg.com>, Matt O'Hara 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 -- -- 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