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

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

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文件如下:

[package]
name = "gstreamerDemo"
version = "0.1.0"
edition = "2021"

[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
gdk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
gtk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }

gst = { version = "0.20.2", package = "gstreamer" }

[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.24"
objc = "0.2.7"

代码(精简部分)如下:

#[path = "../common.rs"]
mod tutorials_common;

fn tutorial_main() {
    // 初始化GStreamer
    gst::init().unwrap();
    ...
}
英文:

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

[package]
name = "gstreamerDemo"
version = "0.1.0"
edition = "2021"

[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
gdk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
gtk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }

gst = { version = "0.20.2", package = "gstreamer" }

[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.24"
objc = "0.2.7"

code (minimal)

#[path = "../common.rs"]
mod tutorials_common;

fn tutorial_main() {
    // Initialize GStreamer
    gst::init().unwrap();
    ...
}

答案1

得分: 2

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

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:

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:

确定