未明确引用gfortran_runtime_error

时间:2015-02-03 12:52:14

标签: fortran ubuntu-14.04 gfortran

我想运行一个模型是在Ubuntu 14.04下编写的Fortran90。我使用gfortran 95编译器(gfortran 4:4.8.2-1ubuntu6)。所需的netCDF库(netCDF C和Fortran netCDF)按照http://www.unidata.ucar.edu/software/netcdf/docs/中的建议安装。 netcdf构建为共享库,因此libnetcdf.so和libnetcff.so文件位于库目录中。为与共享库链接的GNU fortran应用程序安装了libgfortran3 4.8.2-19ubuntu1。 LDFLAGS通过以下方式在compiler_options.inc文件中设置:

INCDF=-I$(NCPATH)/include
LNCDF=-L$(NCPATH)/lib -lnetcdff -lnetcdf
LDFLAGS=$(INCDF) $(LNCDF)

编译模型时,我收到以下消息:

/home/Beata/kid_a_setup/src/test_cases_2d.f90:1446: undefined reference to `_gfortran_runtime_error_at

有人可以解释一下导致错误的原因以及如何解决错误吗?

1 个答案:

答案 0 :(得分:1)

_gfortran_runtime_error_at的未定义引用表示尚未找到libgfortran库。

您的系统配置错误(您可以使用gfortran编译,链接和运行“Hello,world”程序吗?),或者您使用gcc命令进行链接而不是{{1用于链接。 gfortran不了解libgfortran库,其中定义了_gfortran_runtime_error_at。