Daniel
Daniel

Reputation: 15453

error: could not find system library 'gobject-2.0' required by the 'gobject-sys' crate

I tried running cargo run on my MacBookPro for a GTK3/Rust application and I am getting this error:

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

Not sure what occurred here nor how to resolve it.

Upvotes: 3

Views: 2720

Answers (2)

montrealist
montrealist

Reputation: 5693

For what it's worth, installing glib with Brew helped me get over a similar error:

brew install glib

Upvotes: 0

Mahdi Javid
Mahdi Javid

Reputation: 1

Install the dependency:

sudo apt-get install libglib2.0-dev

Upvotes: -3

Related Questions