Hello...
I'm trying to compile a old code using a make file originally intended for HP, and I've successfully compiled it on several other Unix platforms before (SUN and Solaris). I'm now trying to compile this on my Mac (osx 10.3.9), and I'm getting the following error:
g77 -g -e -c inv1d.f
/usr/bin/ld: Undefined symbols:
_main
_c_abs
_c_exp
_conjug_
etc, etc, etc
/usr/bin/ld: entry point symbol name: -c not defined
collect2: ld returned 1 exit status
make: *** [inv1d.o] Error 1
So.... some of the things in the "undefined symbols" list are other subroutines the main code is linking too.
Obviously, it doesn't like the -c option (what should I use with g77 instead to make just .o files?). I've added a -lgcc to the command that is creating all the *.o files, then things work a little better. It now makes the .o files, but complains later:
g77 -g -e -lgcc -c inv1d.f
g77 -g -e lgcc -c conjug.f
etc, etc, etc
/usr/bin/ld: Undefined symbols:
_MAIN__
/usr/bin/ld: entry point symbol name: inv1d.o not defined
collect2: ld returned 1 exit status
Ergh! I'm really out of my league with this sort of thing, so I'm not sure what to do next. Any ideas? It seems like I just need another flag somewhere during the linking step, and everything would be fine....
Thanks!
Donna
Hi Donna -
I've done a bit of work porting old unix code to Mac OS X. First thing I'd suggest is modifying your Makefile so that the arguments for g77 become:
-g -ffixed-line-length-132
instead of
-g -e
(-e on Solaris anyway implies extended source line support, i.e. allow fortan lines longer than 72 characters).
See if that helps and let me know how it goes!
--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com
Glad to help - thanks for using macosx.com!
--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com