glibconfig.h no such file or directory
65,967
Use pkg-config.
gcc `pkg-config --cflags glib-2.0` foo.c `pkg-config --libs glib-2.0`
Related videos on Youtube
Author by
dali1985
Updated on July 09, 2022Comments
-
dali1985 over 1 yearI just installed glib in Raspbian(Debian version). I want to read a config file using glib. I am trying to write a C application in Codeblocks and I use the header
#include <glib.h>But I have an error in gtypes.h
fatal error:glibconfig.h No such file or directoryI used this path
project->Build Options->Compiler Settings->Other Optionsand I added
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/includeas I read in this tutorial. I have to declare also
-L/usr/lib -lm -lglib-2.0as the tutorial says and if yes then where and how can I declare it in Codeblocks?
-
pcbabu over 10 yearsseems everything ok unless your path are wrong... -
dali1985 over 10 yearsmaybe the problem is that I did not declare yet the -L/usr/lib -lm -lglib-2.0 because I don´t know how and where to declare it in Codeblocks
-
-
YvesgereY over 5 yearsYou can factorize invocation:gcc foo.c `pkg-config --cflags --libs glib-2.0` -
mattn about 2 yearsIt won't work on Windows. Windows require order of libraries.