我尝试在 MacBookPro 上运行
cargo run
来运行 GTK3/Rust 应用程序,但收到此错误:
cargo:warning=`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "gobject-2.0" "gobject-2.0 >= 2.56"` did not exit successfully: exit status: 1
error: could not find system library 'gobject-2.0' required by the 'gobject-sys' crate
--- stderr
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
不确定这里发生了什么,也不知道如何解决。
无论如何,使用 Brew 安装
glib
帮助我克服了类似的错误:
brew install glib
安装依赖:
sudo apt-get install libglib2.0-dev