arturoc / gstreamer1.0-rs

Idiomatic bindings for Gstreamer on Rust.
MIT License
36 stars 14 forks source link

cargo test failures #23

Closed gui81 closed 7 years ago

gui81 commented 7 years ago

I have a couple of errors when attempting to run cargo test. One is that there are mut errors. The other is that I have link errors. I put a comment on #14 stating that I could also not build on my Mac. I know that one is about MacPorts, and I am using homebrew, but figured it was all related to building on the Mac. I have also attempted installing all gstreamer packages on RHEL 7 and Ubuntu 17.04, also without any luck.

So, first off, I would like to know what environment you are using to actually run 'cargo test'. Second, does this work with all stable versions of gstreamer 1.[2,4,6,8,10]? And, lastly, if I am using an unsupported/tested environment, then what might I do to fix my errors?

Thanks for any help you might be able to provide.

Below are the errors I am seeing on Ubuntu 17.04 with gstreamer 1.10:

Compiling gstreamer v0.6.4 (file:///gstreamer1.0-rs)
examples/appsrc.rs:18:2: 18:12 error: cannot borrow immutable local variable `bufferpool` as mutable
examples/appsrc.rs:18   bufferpool.set_params(&appsrc_caps,640*480*3,0,0);
                        ^~~~~~~~~~
examples/appsrc.rs:16:6: 16:16 note: use `mut bufferpool` here to make mutable
examples/appsrc.rs:16   let bufferpool = gst::BufferPool::new().unwrap();
                            ^~~~~~~~~~
examples/appsrc.rs:19:5: 19:15 error: cannot borrow immutable local variable `bufferpool` as mutable
examples/appsrc.rs:19   if bufferpool.set_active(true).is_err(){
                           ^~~~~~~~~~
examples/appsrc.rs:16:6: 16:16 note: use `mut bufferpool` here to make mutable
examples/appsrc.rs:16   let bufferpool = gst::BufferPool::new().unwrap();
                            ^~~~~~~~~~
examples/appsrc.rs:30:33: 30:43 error: cannot borrow immutable captured outer variable in an `FnOnce` closure `bufferpool` as mutable
examples/appsrc.rs:30           if let Some(mut buffer) = bufferpool.acquire_buffer(){
                                                          ^~~~~~~~~~
error: aborting due to 3 previous errors
Build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/gstreamer1.0-rs/target/debug/examples/decodebin.0.o" "-o" "/gstreamer1.0-rs/target/debug/examples/decodebin" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/gstreamer1.0-rs/target/debug" "-L" "/gstreamer1.0-rs/target/debug/deps" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/gstreamer1.0-rs/target/debug/libgst.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-e8edd0fd.rlib" "-l" "gstvideo-1.0" "-l" "gstapp-1.0" "-l" "gstbase-1.0" "-l" "gstreamer-1.0" "-l" "gobject-2.0" "-l" "glib-2.0" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-l" "compiler-rt"
note: /usr/bin/ld: cannot find -lgstvideo-1.0
/usr/bin/ld: cannot find -lgstapp-1.0
collect2: error: ld returned 1 exit status

error: aborting due to previous error
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/gstreamer1.0-rs/target/debug/examples/appsink_no_sync.0.o" "-o" "/gstreamer1.0-rs/target/debug/examples/appsink_no_sync" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/gstreamer1.0-rs/target/debug" "-L" "/gstreamer1.0-rs/target/debug/deps" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/gstreamer1.0-rs/target/debug/libgst.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-e8edd0fd.rlib" "-l" "gstvideo-1.0" "-l" "gstapp-1.0" "-l" "gstbase-1.0" "-l" "gstreamer-1.0" "-l" "gobject-2.0" "-l" "glib-2.0" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-l" "compiler-rt"
note: /usr/bin/ld: cannot find -lgstvideo-1.0
/usr/bin/ld: cannot find -lgstapp-1.0
collect2: error: ld returned 1 exit status

error: aborting due to previous error
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/gstreamer1.0-rs/target/debug/gst-ab00a1dfaef20abb.0.o" "-o" "/gstreamer1.0-rs/target/debug/gst-ab00a1dfaef20abb" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/gstreamer1.0-rs/target/debug" "-L" "/gstreamer1.0-rs/target/debug/deps" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-l" "gstvideo-1.0" "-l" "gstapp-1.0" "-l" "gstbase-1.0" "-l" "gstreamer-1.0" "-l" "gobject-2.0" "-l" "glib-2.0" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-e8edd0fd.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-e8edd0fd.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-l" "compiler-rt"
note: /usr/bin/ld: cannot find -lgstvideo-1.0
/usr/bin/ld: cannot find -lgstapp-1.0
collect2: error: ld returned 1 exit status

error: aborting due to previous error
error: Could not compile `gstreamer`.
arturoc commented 7 years ago

this is fixed now. thanks!