/usr/include/glib-2.0/glib/gtypes.h:34:24: fatal error: glibconfig.h: No such file or directory

时间:2021-04-08 07:01:48

cc -DDEBUG -mtune=core2 -O2 \
-onvideo nvideo.c \
-I/usr/include/atk-1.0 \
-I/usr/include/cairo \
-I/usr/include/gdk-pixbuf-2.0 \
-I/usr/include/glib-2.0 \
-I/usr/include/gtk-3.0 \
-I/usr/include/pango-1.0 \
-I/usr/include/libxml2 \
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
-lpthread \
-lgtk-3 -lgobject-2.0 -lgthread-2.0 \
-lxml2
In file included from /usr/include/glib-2.0/glib/galloca.h:34:0,
from /usr/include/glib-2.0/glib.h:32,
from /usr/include/gtk-3.0/gdk/gdkconfig.h:13,
from /usr/include/gtk-3.0/gdk/gdk.h:32,
from /usr/include/gtk-3.0/gtk/gtk.h:32,
from nvideo.c:11:
/usr/include/glib-2.0/glib/gtypes.h:34:24: fatal error: glibconfig.h: No such file or directory
compilation terminated.
make: *** [edit] Error 1

因为之前已经安装了gtk开发包,所以理论上不应该出现找不到.h文件的问题。最后发现问题出在-I/usr/lib/x86_64-linux-gnu/glib-2.0/include参数上。因为之前使用的64位,所以这个位置没有问题,但是现在我用的是32位系统,所以导致这个路径指错了,增加-I/usr/lib/i386-linux-gnu/glib-2.0/include 即可。

实际使用应该使用pkg-config来配置这个路径的,但是我想手工去完成这个事情,所以导致了这个问题。还弄得满世界去找是不是少装了哪个开发包~~:)