我已经下载了GTK4演示,并将其放在一个目录中。我已经在VC中打开了它,并尝试按照Read.ME运行演示。
PS D:\Rust\Projects\gtk4-rs-master\examples\basics> cargo run --bin basics
Compiling pango-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#bba02e39)
Compiling cairo-sys-rs v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#bba02e39)
Compiling graphene-sys v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#bba02e39)
Compiling gdk4-sys v0.5.0 (D:\Rust\Projects\gtk4-rs-master\gdk4\sys)
Compiling gsk4-sys v0.5.0 (D:\Rust\Projects\gtk4-rs-master\gsk4\sys)
The following warnings were emitted during compilation:
warning: `"pkg-config" "--libs" "--cflags" "cairo" "cairo >= 1.14"` did not exit successfully: exit code: 1
error: failed to run custom build command for `cairo-sys-rs v0.16.0 (https://github.com/gtk-rs/gtk-rs-core#bba02e39)`
Caused by:
process didn't exit successfully: `D:\Rust\Projects\gtk4-rs-master\target\debug\build\cairo-sys-rs-45e88069668b1029\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-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_msvc
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-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
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-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
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-msvc
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:warning=`"pkg-config" "--libs" "--cflags" "cairo" "cairo >= 1.14"` did not exit successfully: exit code: 1
error: could not find system library 'cairo' required by the 'cairo-sys-rs' crate
--- stderr
Failed to open 'C:/msys64/mingw64/lib/pkgconfig\harfbuzz.pc': Too many open files
Package 'harfbuzz', required by 'FreeType 2', not found
warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:
warning: `"pkg-config" "--libs" "--cflags" "pango" "pango >= 1.46"` did not exit successfully: exit code: 1
The following warnings were emitted during compilation:
warning: `"pkg-config" "--libs" "--cflags" "gtk4" "gtk4 >= 4.0.0"` did not exit successfully: exit code: 1
error: build failed
PS D:\Rust\Projects\gtk4-rs-master\examples\basics>有什么办法解决这个问题吗?
发布于 2022-05-02 22:32:57
答案是另一个使用GTK的应用程序在路径上比我的Rust编译器条目高。当我把它移到编译的应用程序时。
发布于 2022-08-28 06:01:10
这个问题是从错误信息中提出来的,但对我来说却是另一个原因。对我来说是用Linuxbrew。我完全卸载了它,https://docs.brew.sh/FAQ#:~:text=How%20do%20I%20uninstall%20Homebrew,from%20the%20Homebrew%2Finstall%20repository。
另一个用户在这里也经历了类似的事情-- https://github.com/tauri-apps/tauri/issues/3856
https://stackoverflow.com/questions/71453864
复制相似问题