gstreamer-rust库 libgobject-2.0.0.dylib 未加载

huangapple go评论175阅读模式
英文:

gstreamer-rust library libgobject-2.0.0.dylib not loaded

问题

尝试运行gstreamer-rs的教程时出现错误。

错误信息为:

dyld[62967]: Library not loaded:... @rpath/libgobject-2.0.0.dylib '/usr/lib/libgobject-2.0.0.dylib' (no such file, not in dyld cache)

libgobject-2.0.dylib位于**/Library/Frameworks/GStreamer.framework/Versions/1.0/lib**中。

Cargo.toml文件如下:

  1. [package]
  2. name = "gstreamerDemo"
  3. version = "0.1.0"
  4. edition = "2021"
  5. [dependencies]
  6. glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
  7. gdk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
  8. gtk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
  9. gst = { version = "0.20.2", package = "gstreamer" }
  10. [target.'cfg(target_os = "macos")'.dependencies]
  11. cocoa = "0.24"
  12. objc = "0.2.7"

代码(精简部分)如下:

  1. #[path = "../common.rs"]
  2. mod tutorials_common;
  3. fn tutorial_main() {
  4. // 初始化GStreamer
  5. gst::init().unwrap();
  6. ...
  7. }
英文:

Trying to run the tutorials of gstreamer-rs

getting the error

dyld[62967]: Library not loaded:... @rpath/libgobject-2.0.0.dylib '/usr/lib/libgobject-2.0.0.dylib' (no such file, not in dyld cache)

libgobject-2.0.dylib is part of /Library/Frameworks/GStreamer.framework/Versions/1.0/lib

Cargo.toml

  1. [package]
  2. name = "gstreamerDemo"
  3. version = "0.1.0"
  4. edition = "2021"
  5. [dependencies]
  6. glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
  7. gdk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
  8. gtk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
  9. gst = { version = "0.20.2", package = "gstreamer" }
  10. [target.'cfg(target_os = "macos")'.dependencies]
  11. cocoa = "0.24"
  12. objc = "0.2.7"

code (minimal)

  1. #[path = "../common.rs"]
  2. mod tutorials_common;
  3. fn tutorial_main() {
  4. // Initialize GStreamer
  5. gst::init().unwrap();
  6. ...
  7. }

答案1

得分: 2

添加一个符号链接到/Library/Frameworks/GStreamer.framework/Versions/1.0/lib目录下的文件就可以解决问题,示例如下:

  1. sudo ln -s /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/*.dylib /usr/local/lib/

我更倾向于一个更好的解决方案,比如动态链接。如果有人能发布一个有效的示例,我将接受它作为解决方案。

英文:

adding a symbolic link to the files under /Library/Frameworks/GStreamer.framework/Versions/1.0/lib did the trick like:

  1. sudo ln -s /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/*.dylib /usr/local/lib/

I do prefer a better solution like dynamic linkage, If anyone can post a working example, I will accept that as a solution

huangapple
  • 本文由 发表于 2023年3月7日 20:49:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/75662186.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定