Hello all,
I have installed the most recent f2c .rpm on my RH 5.0 system.
I can run f2c and compile the results using gcc just fine.
However, when I try to link the .o's together, I get this
error: "MAIN__ not defined".
Now nm libf2c.a shows that "main" is defined in main.o, and
"MAIN__" is an undefined symbol in main.o. I suppose that
the intent is that if I don't supply a main() function,
then MAIN__() will be called.
But indeed I do have a main() function. This tiny example
shows what happens:
t.c:
main() { return 0; }
% gcc -c t.c
% gcc t.o -o t -lf2c
--> produces "/usr/lib/libf2c.so: undefined reference to `MAIN__'"
What's going on here? Perhaps this is a problem with ld -- the
linker should not even try to search libf2c.so since there are no
undefined symbols in t.o.
Has anyone out there successfully linked programs created
using f2c??
Thanks in advance,
Robert Dodier
PS. Of course, my intention is to link t.c with functions translated
from Fortran by f2c. Perhaps that's not clear in the example.
--
``I was a less than serious student in college. If I had it to do over
again, I would be far more serious. I did play a lot of golf. But I
don't think that's any reflection on my ability to lead this nation.''
-- Vice President Dan Quayle