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: kunert at physik dot tu-dresden dot de
- Subject: Re: *.f *.c linking problem - g77 = gcc (options)?
- From: Craig Burley <burley at gnu dot org>
- Date: Wed, 15 Jul 1998 09:54:47 -0400 (EDT)
- CC: htl10 at cus dot cam dot ac dot uk, egcs-bugs at cygnus dot com
>> f77 src/routine1.f -c -o obj/routine1.o
>> cc src/routine2.c -c -o obj/routine2.o
>> cc src/wrapper.c -c -o obj/wrapper.o
>> -----where wrapper.c contains a main() routine
>> f77 -o result-binary obj/*.o -llib1 -llib2
>>
>> This does not work for egcs g77 since libf2c contains main.o also.
>[...]
>
>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.
My guess is that the original problem was partly due to the Fortran
code being compiled including calls to GETARG or IARGC. It's hard
to tell without more complete bug reports.
tq vm, (burley)