glib.h: No such file or directory

chinmay picture chinmay · Jul 30, 2017 · Viewed 22.4k times · Source

I tried installing gtk and glib using

sudo apt-get install libglib2.0-dev

and

sudo apt-get install libgtk2.0-dev

but locate glib.h does not return any path for glib results of locate glib.h are

$ locate glib.h
/home/asus/Qt5.8.0/5.8/Src/qtbase/src/3rdparty/libjpeg/jpeglib.h
/home/asus/Qt5.8.0/5.8/Src/qtimageformats/src/3rdparty/jasper/src/libjasper/jpg/jpg_jpeglib.h
/home/asus/Qt5.8.0/5.8/Src/qtwebengine/src/3rdparty/chromium/base/message_loop/message_pump_glib.h
/home/asus/Qt5.8.0/5.8/Src/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/hb-glib.h
/home/asus/Qt5.8.0/5.8/Src/qtwebengine/src/3rdparty/chromium/third_party/libjpeg/jpeglib.h
/home/asus/Qt5.8.0/5.8/Src/qtwebengine/src/3rdparty/chromium/third_party/libjpeg_turbo/jpeglib.h
/home/asus/Qt5.8.0/5.8/Src/qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/libjpeg/jpeglib.h
/home/asus/Qt5.8.0/5.8/Src/qtwebengine/src/3rdparty/chromium/ui/events/platform/x11/x11_event_source_glib.h
/usr/include/reglib/reglib.h
/usr/src/linux-headers-4.8.0-36-generic/include/config/blk/dev/bsglib.h

using updatedb solves this error.

But I get 1 more error fatal error: glibconfig.h: No such file or directory

I think it is related to glib also

I got the answer pkg-config --cflags --libs gtk+-2.0 flag solves this

Answer

alk picture alk · Jul 30, 2017

but locate glib.h does not return any path for glib

You might want to update locate's database (by running updatedb), or wait until tomorrow ... ;-)