GLib compile error (ffi.h), but libffi is installed

deltaluca picture deltaluca · Oct 19, 2012 · Viewed 79.8k times · Source

After a succesful configure, make exits with snipped

gclosure.c:29:17: fatal error: ffi.h: No such file or directory
compilation terminated.

I have libffi installed, and locate ffi.h gives:

/home/luca/gcc4.6/gcc-4.6.0/libffi/include/ffi.h.in
/usr/include/x86_64-linux-gnu/ffi.h
/usr/share/doc/ghc-doc/html/users_guide/ffi.html
/usr/share/doc/libffi5/html/Using-libffi.html

Answer

Eric Milliot-Martinez picture Eric Milliot-Martinez · Jul 8, 2013

If you have a Debian-based Linux OS with apt-get:

sudo apt-get install libffi-dev

With a Redhat-base OS:

yum install libffi-devel

With Alpine Linux:

apk add libffi-dev