Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glibconfig.h no such file or directory

I 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 directory

I used this path

project->Build Options->Compiler Settings->Other Options 

and I added

-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

as I read in this tutorial. I have to declare also

-L/usr/lib -lm -lglib-2.0 

as the tutorial says and if yes then where and how can I declare it in Codeblocks?

like image 736
dali1985 Avatar asked Jun 28 '13 08:06

dali1985


1 Answers

Use pkg-config.

gcc `pkg-config --cflags glib-2.0` foo.c `pkg-config --libs glib-2.0`
like image 113
mattn Avatar answered Oct 15 '22 09:10

mattn