Makefile /usr/bin/ld:找不到-lnetcdf

Makefile /usr/bin/ld:找不到-lnetcdf,makefile,fortran90,Makefile,Fortran90,我面临一个问题, 当我使用Makefile安装软件时,我遇到了这个错误 /usr/bin/ld: cannot find -lg2c 当我搜索libg2c时 它显示了路径: /home/guest/Downloads/mdsplus/math/libg2c.a /home/initm03/Desktop/mdsplus/math/libg2c.a /home/initm03/Downloads/mdsplus/math/libg2c.a /usr/local/mdsplus/math/libg

我面临一个问题, 当我使用Makefile安装软件时,我遇到了这个错误

/usr/bin/ld: cannot find -lg2c
当我搜索libg2c时

它显示了路径:

/home/guest/Downloads/mdsplus/math/libg2c.a
/home/initm03/Desktop/mdsplus/math/libg2c.a
/home/initm03/Downloads/mdsplus/math/libg2c.a
/usr/local/mdsplus/math/libg2c.a

请尽可能让需要的人知道链接器需要在哪里查找库


使用
--library path
命令行开关或
LD_library_path
环境变量指定库的路径。

在makefile中,您需要告诉链接器在哪里可以找到libg2c

改变

-lg2c
在makefile中的链接器选项中

-L/usr/local/mdsplus/math -lg2c
…它应该能够找到它并正确链接