13

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

chinmay
  • 321
  • 1
  • 6
  • 19

2 Answers2

4

Add -I/usr/include/glib-2.0 to your compiler command line (check the path of course). You will need to amend your makefile probably

0___________
  • 60,014
  • 4
  • 34
  • 74
  • It looks as if the question is about the `locate` command and not about `gcc`. – alk Jul 30 '17 at 15:17
  • Interesting downvotes. @alk I had this "problem" some time ago and unfortunately updating the database (I was same smart as you) did not help. Maybe now it is sorted. So this workaround was the quickest solution. – 0___________ Jul 30 '17 at 15:21
  • Running `updatedb` would help `locate` only, sure. It won't help GCC. But well, the question is about `locate`, isn't it? I removed my downvote, BTW. – alk Jul 30 '17 at 15:24
  • BTW^2: doing `find / -name glib.h` might still be faster then running `updatedb`. – alk Jul 30 '17 at 15:25
  • Maybe I do not understand something but usually .h files are used during the programming and compiling (of course I can be wrong). I don't think that he needs it to print and use as a wallpaper or maybe a giftwrap. – 0___________ Jul 30 '17 at 15:27
  • You'll never know ... ;-) – alk Jul 30 '17 at 15:35
  • @alk :) BTW ls -d /usr/include/g* is even quicker – 0___________ Jul 30 '17 at 15:47
  • This uses "local" knowledge, not fair ... ;-) – alk Jul 30 '17 at 15:48
4

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 ... ;-)

alk
  • 69,737
  • 10
  • 105
  • 255