arturoc / gstreamer1.0-rs

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

GStreamer won't link on MacOS X + MacPorts #14

Open Yoric opened 8 years ago

Yoric commented 8 years ago

I'm trying to build this crate and I get the following error

error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib" "/Users/david/Documents/Code/blurbs/gstreamer1.0-rs/target/debug/examples/v4l2.0.o" "-o" "/Users/david/Documents/Code/blurbs/gstreamer1.0-rs/target/debug/examples/v4l2" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/david/Documents/Code/blurbs/gstreamer1.0-rs/target/debug" "-L" "/Users/david/Documents/Code/blurbs/gstreamer1.0-rs/target/debug/deps" "-F" "/Library/Frameworks" "-L" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib" "/Users/david/Documents/Code/blurbs/gstreamer1.0-rs/target/debug/libgst.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/libstd-ca9f0d77.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/libcollections-ca9f0d77.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-ca9f0d77.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/librand-ca9f0d77.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/liballoc-ca9f0d77.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-ca9f0d77.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/liblibc-ca9f0d77.rlib" "/Users/david/.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib/libcore-ca9f0d77.rlib" "-framework" "GStreamer" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m" "-Wl,-rpath,@loader_path/../../../../../../../.multirust/toolchains/stable/lib/rustlib/x86_64-apple-darwin/lib" "-Wl,-rpath,/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-l" "compiler-rt"
note: ld: framework not found GStreamer
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have previously installed gstreamer through MacPorts:

$ sudo port install gstreamer1
gui81 commented 7 years ago

I use homebrew and cannot run 'cargo test' on my Mac without link errors.

arturoc commented 7 years ago

i've only tested this crate using the official sdk from https://gstreamer.freedesktop.org/data/pkg/ as is explained in the readme. not sure what might be the difference with the ports/brew version

squidpickles commented 7 years ago

Yes, looks like the official package installs GStreamer as a framework in /Library/Frameworks; MacPorts and Homebrew install as .so files in {root}/lib/gstreamer-1.0.

@Yoric's changes will enable it to build under Homebrew, at least (I haven't tested MacPorts), but would break the official package.

arturoc commented 7 years ago

yes, i imagine there would be a way to use a feature in the cargo file to enable one or the other