在没有sudo的情况下运行SFML“dyld:库未加载”

时间:2018-03-25 11:29:24

标签: macos rust sfml dynamic-linking dylib

我使用rust-sfml创建了一个最小的SFML应用程序。我删除了任何需要从the pong example加载文件的内容,但只是尝试打开一个窗口会出现此错误:

dyld: Library not loaded: @rpath/libsfml-graphics.2.4.dylib
  Referenced from: /path/to/executable
  Reason: image not found
Trace/BPT trap: 5

使用sudo运行时,程序正常运行。我检查了权限,看起来没错:

$ ls -l /usr/local/lib/*sfml*
-rwxr-xr-x@ 1 myuser  admin   50296  1 Mar  2017 /usr/local/lib/libcsfml-audio.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      26  1 Mar  2017 /usr/local/lib/libcsfml-audio.2.4.dylib -> libcsfml-audio.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      24  1 Mar  2017 /usr/local/lib/libcsfml-audio.dylib -> libcsfml-audio.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin  163680  1 Mar  2017 /usr/local/lib/libcsfml-graphics.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      29  1 Mar  2017 /usr/local/lib/libcsfml-graphics.2.4.dylib -> libcsfml-graphics.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      27  1 Mar  2017 /usr/local/lib/libcsfml-graphics.dylib -> libcsfml-graphics.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin   67272  1 Mar  2017 /usr/local/lib/libcsfml-network.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      28  1 Mar  2017 /usr/local/lib/libcsfml-network.2.4.dylib -> libcsfml-network.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      26  1 Mar  2017 /usr/local/lib/libcsfml-network.dylib -> libcsfml-network.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin   20256  1 Mar  2017 /usr/local/lib/libcsfml-system.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      27  1 Mar  2017 /usr/local/lib/libcsfml-system.2.4.dylib -> libcsfml-system.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      25  1 Mar  2017 /usr/local/lib/libcsfml-system.dylib -> libcsfml-system.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin   31892  1 Mar  2017 /usr/local/lib/libcsfml-window.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      27  1 Mar  2017 /usr/local/lib/libcsfml-window.2.4.dylib -> libcsfml-window.2.4.0.dylib
lrwxr-xr-x  1 myuser  admin      25  1 Mar  2017 /usr/local/lib/libcsfml-window.dylib -> libcsfml-window.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin  159060 10 Feb  2017 /usr/local/lib/libsfml-audio.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      25 10 Feb  2017 /usr/local/lib/libsfml-audio.2.4.dylib -> libsfml-audio.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      23 10 Feb  2017 /usr/local/lib/libsfml-audio.dylib -> libsfml-audio.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin  556312 10 Feb  2017 /usr/local/lib/libsfml-graphics.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      28 10 Feb  2017 /usr/local/lib/libsfml-graphics.2.4.dylib -> libsfml-graphics.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      26 10 Feb  2017 /usr/local/lib/libsfml-graphics.dylib -> libsfml-graphics.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin  162540 10 Feb  2017 /usr/local/lib/libsfml-network.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      27 10 Feb  2017 /usr/local/lib/libsfml-network.2.4.dylib -> libsfml-network.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      25 10 Feb  2017 /usr/local/lib/libsfml-network.dylib -> libsfml-network.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin   81896 10 Feb  2017 /usr/local/lib/libsfml-system.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      26 10 Feb  2017 /usr/local/lib/libsfml-system.2.4.dylib -> libsfml-system.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      24 10 Feb  2017 /usr/local/lib/libsfml-system.dylib -> libsfml-system.2.4.dylib
-rwxr-xr-x@ 1 myuser  admin  227128 10 Feb  2017 /usr/local/lib/libsfml-window.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      26 10 Feb  2017 /usr/local/lib/libsfml-window.2.4.dylib -> libsfml-window.2.4.2.dylib
lrwxr-xr-x  1 myuser  admin      24 10 Feb  2017 /usr/local/lib/libsfml-window.dylib -> libsfml-window.2.4.dylib

版本:

  • macOS 10.11.6
  • Rust 1.26.0-nightly (75af15ee6 2018-03-20)
  • 货物1.26.0-nightly (d6c3983fe 2018-03-16)
  • rust-sfml(来自Cargo.tomlsfml = "0.14"
  • SFML:2.4.2,dylib

0 个答案:

没有答案