rust 错误:找不到'gobject-sys' crate所需的系统库'gobject-2.0'

aoyhnmkz  于 2023-05-22  发布在  Go
关注(0)|答案(1)|浏览(726)

我尝试在我的MacBookPro上运行cargo run的GTK 3/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

我不知道这里发生了什么,也不知道如何解决。

6kkfgxo0

6kkfgxo01#

安装依赖项:

sudo apt-get install libglib2.0-dev

相关问题