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


>> gcc -lf2c_broken -Wall -o bin/sim -l -nag

Why are you using that ordering?  And what does `-l' by itself do, or
`-nag'?  I don't recognize that stuff.

The normal way to link libf2c is:

  gcc foo.f bar.c ... -lf2c -lm

That is, -lf2c (or -lf2c_broken) should precede -lm every time, but
both should follow all Fortran (or C output by f2c) modules.

>> g77  -Wall -o bin/sim  -lm -lnag

-v hopefully would show that `-lg2c' gets inserted automatically by
g77 before `-lm'.  Which might be not what you want....

>> /home/Hin-Tak/egcs-1.0.3a/gcc/f/runtime/libF77/main.c:128: undefined
>> reference to `MAIN__'

That's because you didn't link any non-library code, in particular,
no Fortran main program unit compiled by g77 or f2c, and, besides,
no main() program unit (unless you indeed specify -lg2c, which
has one of those).

        tq vm, (burley)


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