undefined reference to gst_stream_type_get_type
Created by: AndreKR
What I did:
- Install Rust with
rustup-init.exe
and choosex86_64-pc-windows-gnu
as default triple. - Install MSYS2
- Inside the msys2-mingw64 shell run the command from here
- Create a new Rust project with
cargo new --bin test
- Add
gstreamer = "0.10.0"
to my Cargo.toml dependencies - Create main.rs:
extern crate gstreamer as gst;
fn main() {
gst::init().unwrap();
}
Now, because I got an error ld: cannot find -lgstreamer-1.0
(and the same for gobject-2.0
, glib-2.0
and gobject-2.0
) I tried setting environment variables:
set PKG_CONFIG_PATH=C:\dev\msys64\mingw64\lib\pkgconfig
set LIBRARY_PATH=C:\dev\msys64\mingw64\lib
After I set LIBRARY_PATH
, the error changed to:
C:\dev-projects\rust-test\test\target\debug\deps\libgstreamer-70220f7014e9955f.rlib(gstreamer-70220f7014e9955f.gstreamer8.rust-cgu.o): In function gstreamer::auto::flags::{{impl}}::static_type': c:\dev\rust\cargo\registry\src\github.com-1ecc6299db9ec823\gstreamer-0.10.0\src\auto/flags.rs:807: undefined reference to gst_stream_type_get_type'