So I'm having a little trouble with the fortran to C library. Now, before I get into the problem, I can tell you that I cannot use g2c as some forum sites have suggested.
Now, to the problem. When I try to compile a very large project, I get the following:
[from the makefile...] g++ -L [~200 dirs] -l [~200 libs] -lf2c
/usr/lib/libf2c.so: undefined reference to 'MAIN__'
collect2: ld returned 1 exit status
make: *** [all] Error 1
Now, I have checked my /usr/lib
directory and have come up with the following:
$ locate libf2c
/usr/lib/libf2c.so
/usr/lib/libf2c.so.0
/usr/lib/libf2c.so.0.22
So at the very least, it is there. I used the google, which told me that entering...
sudo rm /usr/lib/libf2c.so && sudo ln -s /usr/lib/libf2c.a /usr/lib/libf2c.so
...would help. Something about the oldness of the library meaning that gcc doesn't link to it right anymore, and tries to find a main method where there isn't one. So I did it. However, after I linked to the .a library, g++ now can't find the library at all.
g++ -L [~200 dirs] -l [~200 libs] -lf2c
/usr/bin/ld: cannot find -lf2c
collect2: ld returned 1 exit status
make: *** [all] Error 1
So in effect I've gone backwards. Anyone have any ideas as to where I should go from here?
EDIT: So I think I figured it out. I followed this to reinstall the libs. Now it magically does not complain that the fortran main doesn't exist. Thanks for your help guys.