英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论