Gclosure.c:30:10: fatal error: 'ffi.h' file not found

I cannot compile glib due to above error.
My settings are:

meson _builddir --wipe -Dmultiarch=true --buildtype=release -Ddefault_library=static 
ninja -C _builddir

results in:

[385/1321] Compiling C object gobject/libgobject-2.0.a.p/gclosure.c.o
FAILED: gobject/libgobject-2.0.a.p/gclosure.c.o 
cc -Igobject/libgobject-2.0.a.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/ffi -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int -mmacosx-version-min=10.13 -mmacosx-version-min=10.13 '-DG_LOG_DOMAIN="GLib-GObject"' -DGOBJECT_COMPILATION -MD -MQ gobject/libgobject-2.0.a.p/gclosure.c.o -MF gobject/libgobject-2.0.a.p/gclosure.c.o.d -o gobject/libgobject-2.0.a.p/gclosure.c.o -c ../gobject/gclosure.c
../gobject/gclosure.c:30:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
         ^~~~~~~
1 error generated.
  • I work on a macos Ventura (13.3.1)
  • I installed libffi via homebrew
  • pkg-config 0.29.2_3 installed

What else do you need to know?
Can anyone help me with this?

Hi @Vithanco! Could you share your meson.log?

In addition to that, could you check the contents of /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/ffi? In particular, see if there’s any ffi.h file

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.