Node: Cannot Link Fortran Programs, Next: Large Common Blocks, Previous: Signal 11 and Friends, Up: But-bugs
On some systems, perhaps just those with out-of-date (shared?)
libraries, unresolved-reference errors happen when linking
programs (which should be done using
If this happens to you, try appending
-lc to the command you
use to link the program, e.g.
g77 foo.f -lc.
g77 already specifies
-lg2c -lm when it calls the linker,
but it cannot also specify
-lc because not all systems have a
It is unclear at this point whether there are legitimately installed
-lg2c -lm is insufficient to resolve code produced
If your program doesn't link due to unresolved references to names
_main, make sure you're using the
g77 command to do the
link, since this command ensures that the necessary libraries are
loaded by specifying
-lg2c -lm when it invokes the
command to do the actual link.
-v option to discover
more about what actually happens when you use the
Also, try specifying
-lc as the last item on the
command line, in case that helps.