cwjwang的个人博客分享 http://blog.sciencenet.cn/u/cwjwang

博文

FORTRAN 读取 NETCDF解决undefine 诸如undefined reference to

已有 16786 次阅读 2012-10-10 00:04 |系统分类:科研笔记| NetCDF

当出现此类问题的时候
光靠 gfortran -o test w02.f90 -I/usr/local/netcdf/include -L/usr/local/netcdf/lib -lnetcdf 不能解决的,可以尝试gfortran -o test w02.f90 -I/usr/local/netcdf/include -L/usr/local/netcdf/lib -lnetcdf -lnetcdff  或gfortran -o test w02.f90 -I/usr/local/netcdf/include -L/usr/local/netcdf/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz

附上错误的提示,供以后参考
/tmp/ccKcBo4F.o: In function `MAIN__':
w02.f90:(.text+0x39): undefined reference to `nf_create_'
w02.f90:(.text+0x71): undefined reference to `nf_def_dim_'
w02.f90:(.text+0xa9): undefined reference to `nf_def_dim_'
w02.f90:(.text+0xfc): undefined reference to `nf_def_var_'
w02.f90:(.text+0x115): undefined reference to `nf_enddef_'
w02.f90:(.text+0x14e): undefined reference to `nf_close_'
/tmp/ccKcBo4F.o: In function `write_data_0_':
w02.f90:(.text+0x1a7): undefined reference to `nf_put_vara_int_'
/tmp/ccKcBo4F.o: In function `check_err_':
w02.f90:(.text+0x21d): undefined reference to `nf_strerror_'
collect2: ld 返回 1




https://blog.sciencenet.cn/blog-714229-620905.html

上一篇:netcdf-第二章
下一篇:NCO
收藏 IP: 159.226.151.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (1 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-12-25 22:46

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部