dyld: Library not loaded: @rpath/libgfortran.3.dylib

跟風遠走 提交于 2019-12-23 05:35:16

问题


I am trying to learn Fortran programming language, as a test I wrote a simple program like this:

!Fortran Program
program first
print *, "Hello World"
end program first

Then I threw this code file in to mac terminal and run gfortran first.f95 which then gave me an output of a.out as expected. However, when I try to run the output in terminal by navigating into the output directory and typing ./a.out. It gave me this error output:

dyld: Library not loaded: @rpath/libgfortran.3.dylib
  Referenced from: /Users/liang/Desktop/Programs/Fortran/Test/a.out
  Reason: image not found

liang is my username.


回答1:


I had the same problem, and my problem was caused because the library was not in default path and instead "anaconda" got in the path so that's why the compiler could not load it. I am a pure amateur user so I may explain not accurate in terms of technical words.

What I did was, I uninstalled my anaconda and deleted the folder in my Mac. Installed gcc "brew install gcc" again, and it worked! and then after, I installed my anaconda again, so now everything seemingly is ok.



来源:https://stackoverflow.com/questions/49344474/dyld-library-not-loaded-rpath-libgfortran-3-dylib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!