Search code examples
clinuxfedoraglibpkg-config

Not able to find glib.h in fedora 16


I am new to fedora (Linux). Just installed glib packages using yum install glib*. But still not able to compile.enter image description here

I used locate to find where the pkg-config file is. I opened all of these but could not find PKG_CONFIG_PATH environment variable. Any help? :)


Solution

  • pkg-config files are stored in /usr/lib64/pkgconfig/* or /usr/lib/pkgconfig/* (depending on whether you're on 64-bit or 32-bit).

    The glib package contains glib 1.x, for glib 2.x the right package is glib2 (backwards-incompatible API changes require a new package).

    Furthermore, development headers, documentation, pkg-config files, etc., are provided in a separate package, which is usually called '$packagename-devel'. This split allows you avoid installing all the development stuff if all you want to do is use the library. So, what you really want is yum install glib2-devel.

    Note that, since you know the pkg-config name, you can just do yum provides '*/glib-2.0.pc' (or provide the full path and you'll only get a single result) to find the packages which provide the glib-2.0 pkg-config file. With dnf you can also just do something like dnf install '/usr/lib64/pkgconfig/glib-2.0.pc', not sure if the version of yum from F16 can do the same or not, which brings me to…

    Fedora 16 is way too old. Unless you have a very good reason for using this specific version of Fedora, stop doing so. Beyond being a much less pleasant experience, Fedora 16 is old enough that it is no longer receiving security updates. If you need to use something from that era you should find something that is still supported (RHEL 6 is based of F12, RHEL 7 is based on F19, you can use CentOS if you don't want to pay for support).