*.f *.c linking problem - g77 = gcc (options)?
Dr H. T. Leung
htl10@cus.cam.ac.uk
Tue Jul 14 06:35:00 GMT 1998
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
More information about the Gcc-bugs
mailing list