Closed doivosevic closed 4 years ago
What does pkg-config --libs glib-2.0
output?
Good point. It does say No package 'glib-2.0' found
I did use msys2 to install glib so I can see all these glib files and folders in msys2 and I have
in my path. Which file exactly should be visible in the path? Maybe I'm missing something
The glib-2.0.pc
needs to be in PKG_CONFIG_PATH
but that might not be enough. The pkg-config
from MSYS2 is notoriously broken: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/#installation-windows
Thank you so much! So for the noobs like me you do in CMD (not poweshell, there there's a different syntax to set env variables):
set PKG_CONFIG_ALLOW_CROSS=1
set PKG_CONFIG_PATH=C:\msys64\mingw64\lib\pkgconfig\
cargo build --target=x86_64-pc-windows-gnu
and that should be it I think
set PKG_CONFIG_ALLOW_CROSS=1
Unclear why this is required, unless your pkg-config
is for 32 bit Windows.
Yeah so I rechecked a few times to make sure, I don't remember exactly how I got pkg-config in my msys2 but it seems I really need the =1 as well. I guess some default install somewhere gets you the 32 bit one
What pkg-config have you installed? There are separate ones for mingw32, mingw64, and msys and two implementations: pkgconf and pkg-config (I stripped the python and ruby bindings from the results):
$ pacman -Ss pkg-config
mingw32/mingw-w64-i686-pkg-config 0.29.2-1 (mingw-w64-i686-toolchain)
A system for managing library compile/link flags (mingw-w64)
mingw32/mingw-w64-i686-pkgconf 1.3.8-1
pkg-config compatible utility which does not depend on glib
mingw64/mingw-w64-x86_64-pkg-config 0.29.2-1 (mingw-w64-x86_64-toolchain) [installed]
A system for managing library compile/link flags (mingw-w64)
mingw64/mingw-w64-x86_64-pkgconf 1.3.8-1
pkg-config compatible utility which does not depend on glib
msys/pkg-config 0.29.2-1 (base-devel) [installed]
A system for managing library compile/link flags
msys/pkgconf 0.9.11-1
pkg-config compatible utility which does not depend on glib
You can check by doing type -a pkg-config
:
$ type -a pkg-config
pkg-config is /mingw64/bin/pkg-config
pkg-config is /usr/bin/pkg-config
pkg-config is /bin/pkg-config
In your case, you'd need mingw64/mingw-w64-x86_64-pkg-config
.
Hi everyone, I'm trying to follow https://www.reddit.com/r/rust/comments/86kmhu/compiling_rust_windows_gtk_stepbystep/ and I cannot do a cargo build.
Can anyone help me? I have 0 knowledge about cross compiling or anything related. I'm on Windows 10 Home, using msys2 to get some dependencies and on latest Rust.