[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What is libg2c.a? And why do I have to link to it?

Mikael Hedin <mikael.hedin@gmx.net> writes:
> I have a autoconf test that fails if i don't give -lg2c as extra link
> flags.  Without g2c there are undefined references to e_wsfe, z_abs,
> c_sqrt, etc.  Is not g2c an internal gcc thing?

That sounds like things generated by a FORTRAN compiler like g77.  In
the same way that C functions like printf(), abs(), and sqrt() aren't
implemented directly in the compiler (you need to link with -lc
[always added implicitly by *cc] and -lm), you need an external
library to get the FORTRAN compatibility functions.  Conventionally
these are provided in libraries libF77.a and libI77.a, but g77 seems
to provide a libg2c.a buried under /usr/lib/gcc-lib.

If you don't have libg2c.a, it seems to be included in the g77 (or
g77-2.95) package.

David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell

Reply to: