Kuo-Hsien Chang
Kuo-Hsien Chang

Reputation: 935

Error in gfortran compilation : Undefined symbols for architecture x86_64

The programs have been compiled successfully using ifort. However, I don't know why I have the following error message in gfortran compilation.

Could you let me know how to solve this problem as below showed? Thank you!

gfortran main.o climate.o weather.o vegetation.o biogeochem.o initial.o humidity.o \
    radiation.o readpars.o canopy.o physiology.o snow.o soil.o utilities.o \
    ctemfire.o disturbance.o diagnostics.o io-cfs.o ies-io.o math.o stats.o nag-soil.o \
    -m64 -ffixed-line-length-132 -I/usr/local/include -L/usr/local/lib -lnetcdff -lnetcdf -o ibis

Undefined symbols for architecture x86_64:

  "_time_", referenced from:

      _MAIN__ in main.o

ld: symbol(s) not found for architecture x86_64

collect2: ld returned 1 exit status

make: *** [ibis] Error 1

Upvotes: 0

Views: 3329

Answers (1)

Kuo-Hsien Chang
Kuo-Hsien Chang

Reputation: 935

I found the answer. The "time" function is an intrinsic function in ifort. I have change "time" to "dtime" for gfortran.

Michael

Upvotes: 1

Related Questions