glibconfig.h没有这样的文件或目录 [英] glibconfig.h no such file or directory

查看:1516
本文介绍了glibconfig.h没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Raspbian(Debian版本)中安装了glib.我想使用glib读取配置文件.我正在尝试在Codeblocks中编写一个C应用程序,并且使用了标头

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> 

但是我在gtypes.h中有一个错误

But I have an error in gtypes.h

fatal error:glibconfig.h No such file or directory

我使用了这条路径

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

我添加了

-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?

推荐答案

使用pkg-config.

gcc `pkg-config --cflags glib-2.0` foo.c `pkg-config --libs glib-2.0`

这篇关于glibconfig.h没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆