This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: *.f *.c linking problem - g77 = gcc (options)?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]