delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/29/05:06:13

Date: Tue, 29 Apr 1997 11:48:25 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: sener AT nuclear DOT physics DOT sunysb DOT edu
cc: djgpp AT delorie DOT com
Subject: Re: Help needed with linker and "f2c" (FORTRAN TRANSLATOR)
In-Reply-To: <3364C07E.4AD0@ibm.net>
Message-ID: <Pine.SUN.3.91.970429114804.23034L-100000@is>
MIME-Version: 1.0

On Mon, 28 Apr 1997, Melih Sener wrote:

> I'm rather new to the world of C and I needed to use
> the fortran to c translater called "f2c" for some reason.
> (Some Math packages out there rely on it.)
> I get an error with the linker when try to "make" the library:

Which library?  Is that the libf2c library, or some library that you
need to build using f2c?

> This is the typical makefile command:
>  gcc -c -O2 whatever.c
>  ld -x -r -o whatever.xxx whatever.o
>  copy whatever.xxx whatever.o
> 
> gcc does OK.
> However ld gives the following error:
> "reloc refers to symbol `text' which is not being output"
> If I drop the -x switch in ld everything goes fine.

Please post a complete report.  It doesn't help a bit to see all those
"whatever"s here and there instead of the commands exactly as you
typed them and as the Makefile issued them, and the precise error
messages as printed by the linker.

Generally, it's a bad idea to invoke ld directly rather than via gcc,
because gcc passes some DJGPP-specific arguments to ld, without which
it would generally not work.

> However when I later try to build a program that uses the
> library I get complaints about multiple definitions.
> ("whatever.c" typically refers to "signal.h"
> and is mainly about input/output and error messages.)

Again, please post a complete script of the command and the error
messages.

> I tried the same source on a Linux gcc it worked right out
> of the box.

Are you sure that makefile was supposed to work with DJGPP?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019