I'm trying to run gstreamer crate on macOS (latest version)
but getting use of undeclared crate or module gst
Cargo.toml
[package]
name = "gstreamerDemo"
version = "0.1.0"
edition = "2021"
[dependencies]
gstreamer = "0.20.2"
[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.24"
objc = "0.2.7"
gstreamer is installed using the binaries (and not homebrew)
❯ pwd
/Library/Frameworks/GStreamer.framework
added dependencies using cargo add gstreamer
code:
use gst::prelude::*;
fn main() {
get::init().unwrap();
}
error:
use gst::prelude::*;
^^^ use of undeclared crate or module `gst`
You cannot import a dependency
gstreamerin yourCargo.tomland use it asgstin your source code. You could however rename it, either by directly adding it withor by editing the
Cargo.tomldirectly remove thegstreamer = "0.20.2"and add the following instead:Of course instead of renaming you could also use the crates actual name: