无法在Windows上使用Rust和GTK运行pkg-config [英] Failed to run pkg-config with Rust and GTK on Windows
问题描述
我最近开始在Rust中编程,我喜欢< 3.
I have started programming in Rust recently and I love it <3.
我想用Rust和GTK制作一个小型桌面应用程序.我在Windows计算机上,但是在设置环境时遇到问题.
I want to make a small desktop application with Rust and GTK. I am on a Windows machine, but I am facing a problem while setting up my environment.
我遵循了这些教程:
我实现了代码.我是MSYS2,是GTK交付者.我一步一步地遵循了这些教程,但是当我尝试编译代码时,出现以下错误消息:
I implemented the code. I am MSYS2 as GTK deliverant. I followed these tutorials step by step, but when I try to compile the code, I get the following error message:
"Failed to run `"pkg-config" "--libs" "--cflags" "glib-2.0" "glib-2.0 >= 2.44"`: The System cant find the given file. (os error 2)"
我的项目工作目录如下:
My project working directory looks like this:
. project
├─ Cargo.lock
├─ Cargo.toml
├─ src/
│ └─ main.rs
└─ target/
我目前尚未将MSYS2目录设置为 PATH
变量.我以前尝试过,但是没有结果.
I've currently not set the MSYS2 Directory as PATH
variable. I've tried this before but with no result.
有人知道如何解决吗?
推荐答案
In my case, what resolved it was the solution here, namely
pacman -S mingw-w64-x86_64-pkg-config
pacman -S mingw-w64-x86_64-pkg-config
或
pacman -S mingw-w64-i686-pkg-config
pacman -S mingw-w64-i686-pkg-config
这篇关于无法在Windows上使用Rust和GTK运行pkg-config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!