I have seen several versions of this problem posted on the web. Since the answers were wrong I thought that I would correct them. This particular version was posted by Perry Lee Anthony on Friday May 2, 1997 to the redhat archive. "I have a program that is made up of mostly "c" modules, a few fortran modules, and a few c++ modules. I compile and run this program on many different platforms (AIX, VAX openVMS, Digital Unix, SysV) and have decided to try to compile it on linux. I have RedHat 4.1 and have installed the g77 ver 0.19 that goes with gcc 2.7.2.1 (it replaced the /usr/bin/gcc from the redhat dist with the one that works with g77). I can compile and run fortran programs just fine with g77. Now I make a library that contains fortran modules, c modules, and c++ modules. Then I compile the main c-routine (the module with main()), linking to this library and to the other needed libraries (including libg77). Linking fails with "unresolved reference to MAIN__ in libg77". AARRG. I can't figure out what to do about this, and I'm probably not giving enough information for people to help, but any guesses would be appreciated. Thanks, Perry" In Perry's case as well as in the other case I saw the answer was the same: "link to -lf2c ". At least in my particular case this turned out to be the problem, NOT the solution. My linker message was: "unresolved reference to MAIN__ in /usr/lib/libf2c.so" I did a name list on libf2c (nm /usr/lib/libf2c.so | grep MAIN__) and got back that it was undefined (U MAIN__). Well, when you compile pure fortran using f2c the compiler defines MAIN__ (try writing a hello world program hello.f and then compile it with fort77 -c and then do nm on hello.o) . So the problem then is that libf2c expects to find MAIN__ defined during the final link phase. In my makefile I added the line: .f.o: $(FF) -c -O 2 $< and REMOVED the final link to -lf2c and everything works fine now. I still do not understand what happened during my upgrade that made a working makefile stop working. It seems that under certain conditions linking to -lf2c doesn't work and under other conditions it does. In any case, I believe that the above is a reasonable fix to this problem. I suspect that similar fixes will work for g77 although I haven't tried. Finally, if I am sending this to the wrong place, well, sorry about that! Side remark on a nonportable fix: renaming main() MAIN__() and wrapping extern "C" { MAIN__(){main prog} around main also fixed the problem but I don't recommend this! -- John Pearson E-mail: [EMAIL PROTECTED] XCM MS F645 Phone:(505)-667-7585 Los Alamos National Laboratory Los Alamos, NM 87545 -- PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES! http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject.