Compiling glib on CentOS

Do you get this error message while compiling glib on CentOS ?

checking for LIBFFI... no
configure: error: Package requirements (libffi >= 3.0.0) were not met:

No package 'libffi' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

First, let’s check if libffi is installed:

[laurent@new-host]/usr/lib/pkgconfig> rpm -qa | grep libffi

[laurent@new-host]/> sudo find . -name *libffi*

OK, it is installed, so this certainly means that pkg-config doesn’t know about it. For more information concerning pkg-config, check this link.


[laurent@new-host]/usr/lib/pkgconfig> pkg-config --print-errors libffi
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
No package 'libffi' found

OK: why am I missing the /usr/lib/pkgconfig/libffi.pc file ?

That’s because it’s part of the ‘libffi-devel’ package that is not installed by default !

Install it using yum and you’ll get everything you need:

[laurent@new-host]/usr/lib/pkgconfig> rpm -ql libffi-devel-3.0.5-3.2.el6.i686



About lkubaski

7 Responses to Compiling glib on CentOS

  1. Thank you! I was trying to compile gtk+ (that have a lot of dependences, i’m still trying here…) and your post was helpful so far. Just sorry my bad English, i’m Brazilian. Just… Thank you! o/

  2. lkubaski says:

    He he: thanks a lot for being the first one to comment after 400 views ! đŸ™‚

  3. Pingback: Compilando o glib no CentOS « Documentos do Administrador

  4. I have a blog too and i know how a comment make the people that wrote the post (you) happy. I think we have to be grate when people help us.
    You take part of your time to wrote that. You didn’t need to write what you learned, you can retain it with yourself, but you shared what you learned and comment is the minimum thing i can to do.
    I wrote a post in my blog about this subject (i wrote in PT-BR) and linked for here.
    I see in About page that you’re French. Why did you write in English? I love French and i really want to learn to speak this language someday. I think that it is not too different than portuguese, and everyone says (at least, on Brazil) that Paris is the city of love. Again, my English is not very good, but i hope you can understand u.u

  5. Ashu says:

    Thanks!!!!!!!!!! It was really helpfull. this is what i was exactly looking for.

  6. steve says:

    Perfect. This was the remedy to my problem.

  7. jim says:

    yes thank you.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: