glib.h: No such file or directory
Asked Answered
N

2

14

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

Newman answered 30/7, 2017 at 14:57 Comment(0)
C
6

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

Creepy answered 30/7, 2017 at 15:9 Comment(8)
It looks as if the question is about the locate command and not about gcc.Hypodermic
Interesting downvotes. @Hypodermic 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.Creepy
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.Hypodermic
BTW^2: doing find / -name glib.h might still be faster then running updatedb.Hypodermic
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.Creepy
You'll never know ... ;-)Hypodermic
@Hypodermic :) BTW ls -d /usr/include/g* is even quickerCreepy
This uses "local" knowledge, not fair ... ;-)Hypodermic
H
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 ... ;-)

Hypodermic answered 30/7, 2017 at 15:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.