dyld:库未加载:/usr/local/gfortran/lib/libgfortran.3.dylib 原因:找不到图像 [英] dyld: Library not loaded: /usr/local/gfortran/lib/libgfortran.3.dylib Reason: image not found
问题描述
我尝试了很多解决方法(brew 升级/更新、brew 医生、重新安装 gcc 和 gfortran、导出库路径等)来解决这个问题,但都没有成功.当我尝试执行 Fortran 可执行文件时,我收到相同的错误消息:
I have tried many workarounds (brew upgrade/update, brew doctor, reinstalling gcc and gfortran, exporting libraries path etc.) to solve this issues, but none of them succeeded. When I try to execute a Fortran executable I get the same error message:
dyld:库未加载:/usr/local/gfortran/lib/libgfortran.3.dylib引用自:/用户/...原因:找不到图片
dyld: Library not loaded: /usr/local/gfortran/lib/libgfortran.3.dylib Referenced from: /Users/... Reason: image not found
我已经阅读了许多不同的建议,是否有一套步骤可以解决这个问题?
I have read many different suggestions, is there a set of steps to follow to solve this problem?
谢谢.
更多信息:MacOS 莫哈韦沙漠 10.14.5
More info: MacOS Mojave 10.14.5
哪个 gcc 返回/usr/bin/gcc
which gcc returns /usr/bin/gcc
哪个 gfortran 返回/usr/local/bin/gfortran
which gfortran returns /usr/local/bin/gfortran
推荐答案
SOLVED!
您首先需要找到图书馆:
You need first to locate the library:
locate libgfortran.3.dylib
你应该得到类似的东西
/usr/local/Cellar/gcc@5/5.5.0_3/lib/gcc/5/libgfortran.3.dylib
然后您可以将库链接到正确的文件夹:
Then you can link the library to the right folder:
ln /usr/local/Cellar/gcc@5/5.5.0_3/lib/gcc/5/libgfortran.3.dylib /usr/local/lib/libgfortran.3.dylib
这篇关于dyld:库未加载:/usr/local/gfortran/lib/libgfortran.3.dylib 原因:找不到图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!