www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/08/15:49:47

Date: Sun, 4 Oct 1998 12:44:33 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: George Marsaglia <geo AT stat DOT fsu DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: -lf2c for f2c
In-Reply-To: <3613875B.D29BE24B@stat.fsu.edu>
Message-ID: <Pine.SUN.3.91.981004124410.1863S-100000@is>
MIME-Version: 1.0

On Thu, 1 Oct 1998, George Marsaglia wrote:

> Those C versions warn that  to invoke the gcc compiler, use
> 
>       gcc -lf2c -lm file.c
> in that order.
> 
> But  gcc downloaded from djgpp balks at the -lf2c option.

You didn't post the error message(s), so I'm forced to guess what
might go wrong.

First, I assume that you have libf2c.a in the lib subdirectory of your
main DJGPP directory; if not, please download it and copy it there.

Second, the libraries should be at the end of the GCC command line,
like this:

     gcc file.c -lf2c -lm

This is because the linker used by DJGPP makes only one pass over the
input files, so the order is important (the DJGPP FAQ explains that in
section 8.9).

If the above doesn't help, add -v to the GCC command line, redirect
its output to a file, and post that file.  Here's one way to do that:

    redir -o gcc.txt -eo gcc -v file.c -lf2c -lm

(In this example, the GCC messages go to the file `gcc.txt'.)

- Raw text -


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