Re: gfortran/g77 ld problem: undefined references




Steven,

Thanks for the reply.

Which version of gfortran? Have you filed a bug report?
Not as yet. GNU Fortran 95 (GCC 4.0.0 20041019 (Red Hat 4.0.0-0.8))

These are routines in libg2c.a You need to do something like

gfortran -mcmodel=medium -shared -O -c -ff2c geek.f90

Results in:
f951: error: unrecognized command line option "-ff2c"

gfortran -L/home/rcrump/lib -o geek geek.o -lran -llapack -lblas -lg2c

Leaving out the -ff2c, but adding the -lg2c gives:

gfortran -mcmodel=medium -shared -O -c ga_QTL.f90
gfortran -L/home/rcrump/lib -o ga_QTL ga_QTL.o -lran -llapack
-lblas -lg2c
/usr/bin/ld: cannot find -lg2c
collect2: ld returned 1 exit status
make: *** [ga_QTL] Error 1

Which is a definite improvement in terms of numbers of errors. I can't
locate
libg2c.a on the system (find doesn't find it, at least nowhere that I
have read
privileges for).

Ron.

.



Relevant Pages

  • Re: Scriptbasic - Compiling the generated C code
    ... compiler), which I have used in the past, tell me that it has a GCC ... a command line similar to Microsoft C. ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.system)
  • Re: PyQt-x11-gpl-3.16 compile error
    ... collect2: ld returned 1 exit status ... Checking to see if the qtnetwork module should be built... ... distributions, and may also work for other distributions. ...
    (comp.lang.python)
  • g++ on HPUX
    ... I get a linker error from HPs linker: ... collect2: ld returned 1 exit status ... How can I check the gcc installation/enivronment? ...
    (comp.sys.hp.hpux)
  • Re: [SQLite] Compiling in PHP statically?
    ... collect2: ld returned 1 exit status ... make: Leaving directory ... make clean ...
    (comp.lang.php)
  • Re: [SQLite] Compiling in PHP statically?
    ... collect2: ld returned 1 exit status ... make: Leaving directory ... make clean ...
    (comp.lang.php)