meson: In dependencies requires gobject-introspection but meson dont can find it

Im getting this error line: gobject-introspection dependency was not found, gir cannot be generated. But i have gobject-introspection in my pkg-config list.

pkg-config --libs gobject-introspection-1.0
-L/usr/local/Cellar/gobject-introspection/1.52.1_1/lib -L/usr/local/Cellar/glib/2.52.3/lib -L/usr/local/opt/gettext/lib -lgirepository-1.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation

Target OS build - Mac OS Sierra

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (10 by maintainers)

Most upvoted comments

@ljmf00 I have tried to run the same command it complains about (see the exit code -> 1)

dade@choo:~$ pkg-config --cflags gobject-introspection-1.0
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libffi', required by 'gobject-introspection-1.0', not found
dade@choo:~$ brew search libffi

So i tried

brew reinstall libffi

which reminded me of

libffi is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find libffi you may need to set:
  export LDFLAGS="-L/usr/local/opt/libffi/lib"

For pkg-config to find libffi you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

so then i tried to export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

This fixed the issue, at least on my mac

this is the same error with my situation in os: ubuntu 16.04.5 gobject-introspection dependency was not found, gir cannot be generated.

and when i check meson-logs/meson-log.txt. it shows: Determining dependency 'gobject-introspection-1.0' with pkg-config executable '/usr/bin/pkg-config' Meson encountered an error in file atk/meson.build, line 143, column 8: gobject-introspection dependency was not found, gir cannot be generated

i try to install libgirepository1.0-dev: sudo apt-get install libgirepository1.0-dev

it works.

@niedzielski Debian Sid needed libgirepository1.0-dev.

Program(s) [‘g-ir-scanner’] not found in Ubuntu 18.04 i try to install libgirepository1.0-dev: sudo apt-get install libgirepository1.0-dev

it works.

Program(s) [‘g-ir-scanner’] not found in Ubuntu 18.04 i try to install libgirepository1.0-dev: sudo apt-get install libgirepository1.0-dev

it works.

Instead better sudo apt-get install gobject-introspection

@ljmf00 in my case pkg-config --libs was able to find gobject-introspection-1.0 just fine but --cflags failed with that error, which is the same as not finding it Infact i got the very same error you have with meson. It could be a different case but i think its worth doublechecking

I am using high sierra 10.13.6

@tcitworld thanks, that fixes the build on Ubuntu 17.10 too.