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)?


>> 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)


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