This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: *.f *.c linking problem - g77 = gcc (options)?
- To: Thomas Kunert <kunert at physik dot tu-dresden dot de>
- Subject: Re: *.f *.c linking problem - g77 = gcc (options)?
- From: "Dr H. T. Leung" <htl10 at cus dot cam dot ac dot uk>
- Date: Tue, 14 Jul 1998 11:44:45 +0100 (BST)
- cc: egcs-bugs at cygnus dot com
- Reply-To: "Dr H. T. Leung" <htl10 at cus dot cam dot ac dot uk>
This is the error messages I got, with the egcs g77 or "gcc -lf2c_broken"
(a stripped out version of f2c without main.o):
------------------------------------------------------------------
gcc -lf2c_broken -Wall -o bin/sim -l -nag
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x5a): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [bin/sim] Error 1
g77 -Wall -o bin/sim -lm -lnag
/usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.90.29/libf2c.a(main.o):
In function `main':
/home/Hin-Tak/egcs-1.0.3a/gcc/f/runtime/libF77/main.c:128: undefined
reference to `MAIN__'
collect2: ld returned 1 exit status
make: *** [bin/sim] Error 1
--------------------------------------------------------------
On Tue, 14 Jul 1998, Thomas Kunert wrote:
> Strange. I have done such things for some time now and never had any
> problems. I have no idea how the doubly occuring main()'s are handled,
> but it works without problems. I use c++, not c, but this shouldn't be a
> big difference.
>
> g++ -Wall fortran.o cplusplus.o -lf2c
>
> doesn't even emit a warning.
>
> --
> Thomas Kunert