Mail Archives: djgpp/1995/08/23/14:19:53
egley AT albany DOT net (Skip Egley) writes:
>
>I'm trying to compile fortran code converted to C via f2c.
>I'm getting many undefined references, most (if not all) of which are
>generated by f2c. I'm including all the libraries (i.e. -lgpp -lgpl -lm
>-lpc) that are mentioned in the FAQ. I also used nm to search for these in
>all the libraries.
That's easy: f2c comes with a special library, libf2c (or libf77 and libi77).
You have to link these as well (and you probably don't need -lgpp or -lgpl,
unless you're writing C++), so add "-lf2c" and you should be fine.
>One other thing. Does djgpp support double complex variables. I'm also
>getting an undefined reference to zsqrt and nm doesn't report it being in libm.a
>Do I have to write one myself?
If nm doesn't find a routine in any of the *.a's (beware: it might be somewhere
else than libm!), then it's definitely not there.
OTOH, double complex variables *are* supported: just browse the gcc docs for
__complex__ and you'll see what to do. But there aren't any library routines
for this data types, AFAIK, so you're on your own if you want to do anything
more than +, -, *, /, and complex conjugation on them. But maybe you could
use routines from f2c's library for this (if it does contain them).
Hope this helps a bit
Hans-Bernhard Broeker (Aachen, Germany)
- Raw text -