-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling tutorials on windows #64
Comments
I'm setting up a Windows machine later and try things myself. Will let you know The PKG_CONFIG_PATH should be set to the directory where gstreamer-1.0.pc and other files are located, just like in the README.md where the default path for that for the GStreamer binaries is given. Which variant of Rust did you install, the MSVC or MinGW one? Did you install GStreamer from the binaries (32 or 64 bit?) or msys2, and in case of the former did you install it into the default directory (c:\gstreamer\x86_64) or elsewhere? |
I use MinGW rust and msi binaries for gstreamer, installation defaulted to C:\gstreamer\1.0\x86_64 |
Then you set PKG_CONFIG_PATH to c:\gstreamer\1.0\x86_64\lib\pkgconfig (careful with escaping the backslashes) or /c/gstreamer/1.0/x86_64/lib/pkgconfig |
Also make sure to have the gstreamer/1.0/x86_64/bin directory inside your PATH |
So my final setup is with c:\gstreamer\1.0\x86_64\lib\pkgconfig for PKG_CONFIG_PATH, also I added C:\gstreamer\1.0\x86_64\bin to PATH and managed to get this: error: linking with = note: ld: cannot find -lgstapp-1.0
error: Could not compile ld: cannot find -lgstbase-1.0
error: Could not compile : ld: cannot find -lgstvideo-1.0
error: Could not compile = note: ld: cannot find -lgstreamer-1.0
error: Could not compile |
Ok, I'll check on Windows myself later |
Please also paste the complete compiler output from the very beginning, and the output of "export" or "printenv" |
error = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\Users\╨Ь╨░╨║╤Б╨╕╨╝\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-w = note: ld: cannot find -lgstreamer-1.0
error error | = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\Users\╨Ь╨░╨║╤Б╨╕╨╝\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-w = note
error error | = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\Users\╨Ь╨░╨║╤Б╨╕╨╝\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-w = note: ld: cannot find -lgstreamer-1.0
error error: error = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\Users\╨Ь╨░╨║╤Б╨╕╨╝\.rustup\toolchains\nightly-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-w = note: ld: cannot find -lgstaudio-1.0 error error: To learn more, run the command again with --verbose. |
ALLUSERSPROFILE=C:\ProgramData |
And can you also give the output of "pkg-config --libs --cflags gstreamer-1.0"? |
-mms-bitfields -IC:/gstreamer/1.0/x86_64/include/gstreamer-1.0 -IC:/gstreamer/1.0/x86_64/include/glib-2.0 -IC:/gstreamer/1.0/x86_64/lib/glib-2.0/include -LC:/gstreamer/1.0/x86_64/lib -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lintl |
Ok, so the question is why those -L para,eters don't end up in the compiler, only the -l ones. |
By they way output of pkg-config --libs-only-L gstreamer-1.0 is -LC:/gstreamer/1.0/x86_64/lib I believe this is not a healthy thing |
If you set PKG_CONFIG_PATH to /c/gstreamer/1.0/x86_64/lib, it's better. So I tried locally here, your error happens if you don't have pkg-config installed before you first ran cargo build. Is that possible? If so, cargo clean should solve that, followed by another cargo build --all. However here it then can't find glib-2.0 via pkg-config, while the same works outside cargo. |
Probably because this is not part of the release yet: rust-lang/pkg-config-rs@ea341cf |
Or not. I've reported a bug: rust-lang/pkg-config-rs#51 |
Cargo clean followed by cargo build --all worked! That's awesome. |
Ah, lucky you :) It didn't work for me. Windows is such an unfriendly platform |
By the way, how to deal with the situation like this: [dependencies] gstreamer = "*" cargo build Package links to native library Package And somehow examples with --features "gtksink" are compiled succesfully, how is this possible? |
That's a cargo / general Rust problem. You can only link to a native library once. In your specific case that means that if you use gstreamer from crates.io, you have to use gtk and related crates from crates.io. If you use gtk from GIT master, you also have to use gstreamer (and other glib related crates) from GIT master. Otherwise gtk (from git master) will pull in gobject-sys (from git master), and gstreamer (from crates.io) will pull in gobject-sys (from crates.io), and then you have the native gobject library linked in twice. |
Got it, and another issue related to gtk-rs/gtk#593: if I have my Path variable looking like this: gstreamer works,but gtk init fail because of gtk-rs/gtk#593 if I have my Path like this gtk works fine, and gstreamer does not. What would you recommend here? |
You're having two different versions of glib and other libraries then and will have to fix that up. DLL hell. You likely need to recompile gtk against the gstreamer version or gstreamer against the gtk version. Easiest is probably to install gstreamer also via msys in your case |
Is anything still left to be done here? |
No, closing it. |
Great, thanks for letting me know |
Hey there, I cloned repo and installed gstreamer but getting this error on compiling tutorials:
ld: cannot find -lgstaudio-1.0
ld: cannot find -lgstapp-1.0
ld: cannot find -lgstbase-1.0
ld: cannot find -lgstreamer-1.0
ld: cannot find -lgobject-2.0
ld: cannot find -lglib-2.0
ld: cannot find -lgobject-2.0
Also, i didnt't really understand pkf-config part from readme: should PKG_CONFIG_PATH point to pkg-config.exe OR it should it point to some c:/gstreamer path?
The text was updated successfully, but these errors were encountered: