Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

[HELP] Gtk-rs + Windows 10 #763

Description

@zvladimir

Hello!

I try to use gtk-rs on Windows 10 system but have some trouble.

First - I need to install gtk and follow instructions https://gtk-rs.org/gtk4-rs/stable/latest/book/installation_windows.html

  1. install msys2
  2. pacman -S mingw-w64-x86_64-gtk4 mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc
  3. updated environment vars
C:\msys64\mingw64\include
C:\msys64\mingw64\bin
C:\msys64\mingw64\lib
rustup toolchain install stable-gnu
rustup default stable-gnu

Second - I try gtk example
cargo run --bin basics
and get access error

C:\temp\gtk3-rs\examples>cargo run --bin basics
   Compiling glib-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)
   Compiling gobject-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)
   Compiling gio-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)
   Compiling gdk-pixbuf-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)
   Compiling cairo-sys-rs v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)
   Compiling atk-sys v0.16.0 (C:\temp\gtk3-rs\atk\sys)
   Compiling pango-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)
   Compiling gdk-sys v0.16.0 (C:\temp\gtk3-rs\gdk\sys)
The following warnings were emitted during compilation:

warning: Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "glib-2.0" "glib-2.0 >= 2.56"`, because: Отказано в доступе. (os error 5)

error: failed to run custom build command for `glib-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\glib-sys-8ba52df866badbdf\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=GLIB_2.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "glib-2.0" "glib-2.0 >= 2.56"`, because: Отказано в доступе. (os error 5)
warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "gio-2.0" "gio-2.0 >= 2.56"`, because: Отказано в доступе. (os error 5)

error: failed to run custom build command for `gio-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\gio-sys-8719c2af73cc49c1\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=GIO_2.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "gio-2.0" "gio-2.0 >= 2.56"`, because: Отказано в доступе. (os error 5)
The following warnings were emitted during compilation:

warning: Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "gobject-2.0" "gobject-2.0 >= 2.56"`, because: Отказано в доступе. (os error 5)

error: failed to run custom build command for `gobject-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\gobject-sys-418f85813dba6fdd\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=GOBJECT_2.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "gobject-2.0" "gobject-2.0 >= 2.56"`, because: Отказано в доступе. (os error 5)
The following warnings were emitted during compilation:

warning: Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "gdk-pixbuf-2.0" "gdk-pixbuf-2.0 >= 2.36.8"`, because: Отказано в доступе. (os error 5)

error: failed to run custom build command for `gdk-pixbuf-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\gdk-pixbuf-sys-e2bccb46f620561d\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=GDK_PIXBUF_2.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "gdk-pixbuf-2.0" "gdk-pixbuf-2.0 >= 2.36.8"`, because: Отказано в доступе. (os error 5)
The following warnings were emitted during compilation:

warning: Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "cairo" "cairo >= 1.14"`, because: Отказано в доступе. (os error 5)

error: failed to run custom build command for `cairo-sys-rs v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\cairo-sys-rs-4ef883fd26592a7c\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=CAIRO_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "cairo" "cairo >= 1.14"`, because: Отказано в доступе. (os error 5)
error: failed to run custom build command for `gdk-sys v0.16.0 (C:\temp\gtk3-rs\gdk\sys)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\gdk-sys-c402108360d26da8\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=GDK_3.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "gdk-3.0" "gdk-3.0 >= 3.22"`, because: Отказано в доступе. (os error 5)
The following warnings were emitted during compilation:

warning: Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "atk" "atk >= 2.28"`, because: Отказано в доступе. (os error 5)

error: failed to run custom build command for `atk-sys v0.16.0 (C:\temp\gtk3-rs\atk\sys)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\atk-sys-707da6843218133e\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=ATK_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "atk" "atk >= 2.28"`, because: Отказано в доступе. (os error 5)
The following warnings were emitted during compilation:

warning: Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "pango" "pango >= 1.40"`, because: Отказано в доступе. (os error 5)

error: failed to run custom build command for `pango-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#3a0325e0)`

Caused by:
  process didn't exit successfully: `C:\temp\gtk3-rs\target\debug\build\pango-sys-266559505eef27ed\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=PANGO_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=Failed to run command `"C:\\pkg-config-lite-0.28-1\\bin" "--libs" "--cflags" "pango" "pango >= 1.40"`, because: Отказано в доступе. (os error 5)

and I install pkg-config-lite-0.28-1 in dir C:\pkg-config-lite-0.28-1\bin
and the error is repeated.

What am I doing wrong?
What are the correct instructions for installing gtk-rs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions