首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Rust中克服以下GTK4构建错误

如何在Rust中克服以下GTK4构建错误
EN

Stack Overflow用户
提问于 2022-03-13 01:55:04
回答 2查看 723关注 0票数 0

我已经下载了GTK4演示,并将其放在一个目录中。我已经在VC中打开了它,并尝试按照Read.ME运行演示。

代码语言:javascript
复制
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>

有什么办法解决这个问题吗?

EN

回答 2

Stack Overflow用户

发布于 2022-05-02 22:32:57

答案是另一个使用GTK的应用程序在路径上比我的Rust编译器条目高。当我把它移到编译的应用程序时。

票数 0
EN

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71453864

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档