在学习BLE bluez的时候,做了一个测试程序,看到gatttool.c下面有一个glib解析命令行的功能,想移植到自己的程序接口中,但是添加了#include <glib.h>后,出现了fatal error: glib.h: No such file or directory错误。经过网上查找答案,询问同事,找到了解决方法:在Makefile中添加glib库和头文件。

方法如下

1.安装glib库:

apt-get install libglib2.0-dev

2.(Makefile中):

LINKFLAGS += -lglib-2.0

INCL_PATH +=    -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include/

.SUFFIXES:.c.o.h

$(BIN):$(OBJECTS)

  $(CC) $(CMPOPT)  $(BIN) $(OBJECTS) $(LINKFLAGS)

%.o:%.c

   $(CC) -c $(INCL_PATH) $(CFLAGS) $< $(CMPOPT) $@

fatal error: glib.h: No such file or directory的更多相关文章

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

    cc -DDEBUG -mtune=core2 -O2 \ -onvideo nvideo.c \ -I/usr/include/atk-1.0 \ -I/usr/include/cairo \ -I ...

  2. plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory

    装一台新服务器环境的时候,装uwsgi报错: plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or di ...

  3. [lua]luasocket.c:20:17: fatal error: lua.h: No such file or directory

    安装luasocket的时候出现了如下的错误 问题 $ tar xzf luasocket-2.0.2.tar.gz $ cd luasocket-2.0.2 $ $ make cd src; mak ...

  4. Solve fatal error: helper_math.h: No such file or directory

    When the 'fatal error: helper_math.h: No such file or directory' occurs, it means the 'helper_math.h ...

  5. qingstor python-sdk 安装错误 src/MD2.c:31:20: fatal error: Python.h: No such file or directory

    ubuntu安装python qingstor-sdk, src/MD2.c:31:20: fatal error: Python.h: No such file or directory compi ...

  6. Ubuntu下 fatal error: Python.h: No such file or directory 解决方法

    参考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such file or ...

  7. tesseract编译错误:fatal error: allheaders.h: No such file or directory

    错误描述: globaloc.cpp::: fatal error: allheaders.h: No such file or directory #include "allheaders ...

  8. 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题

    参考: How to install all the boost development libraries? 解决 Boost安装:fatal error: bzlib.h: No such fil ...

  9. caffe编译问题-src/caffe/net.cpp:8:18: fatal error: hdf5.h: No such file or directory compilation terminated.

    错误描述 src/caffe/net.:: fatal error: hdf5.h: No such : recipe 操作过程 step1: 在Makefile.config文件更改INCLUDE_ ...

随机推荐

  1. phpMyAdmin历史漏洞复现

    简介 phpMyAdmin是一个非常受欢迎的基于web的MySQL数据库管理工具.它能够创建和删除数据库,创建/删除/修改表格,删除/编辑/新增字段,执行SQL脚本等 复现三个古老漏洞 phpMyAd ...

  2. Android:自定义BaseActivity基类

    使用BaseActivity可以封装一些重复代码例如设置标题栏颜色,封装一些工具类... 主要功能: 封装Toast 新建一个BaseActivity继承自Activity package com.o ...

  3. Spring+hibernate+JSP实现Piano的数据库操作---1.目录结构+展示

    目录结构 界面

  4. math库常用函数

  5. Python os.getcwdu() 方法

    概述 os.getcwdu() 方法用于返回一个当前工作目录的Unicode对象.高佣联盟 www.cgewang.com Unix, Windows 系统下可用. 语法 getcwdu()方法语法格 ...

  6. PHP jdtounix() 函数

    ------------恢复内容开始------------ 实例 把格利高里历法的日期转换为儒略日计数,然后把儒略日计数转换为 Unix 时间戳: <?php$jd=gregoriantojd ...

  7. CF724C Ray Tracing 扩展欧几里得 平面展开

    LINK:Ray Tracing 虚这道题很久了 模拟赛考了一个加强版的 瞬间就想到了这道简化版的. 考虑做法 暴力模拟可能可以 官方正解好像就是这个. 不过遇到这种平面问题可以考虑把平面给无限的展开 ...

  8. (恐怕是)写得最通俗易懂的一篇关于HashMap的文章——xx大佬这样说

    先看再点赞,给自己一点思考的时间,微信搜索[沉默王二]关注这个有颜值却假装靠才华苟且的程序员. 本文 GitHub github.com/itwanger 已收录,里面还有一线大厂整理的面试题,以及我 ...

  9. 永久修改Ubuntu的主机名称

    Ubuntu主机名称查看方法,使用hostname命令: [ubuntu@ubuntu ~]$hostname ubuntu 永久修改方法: 修改配置文件: sudo vi /etc/hostname ...

  10. 入门实践,Python数据分析

    1-2 Anaconda和Jupyter notebook介绍 很多人学习python,不知道从何学起.很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手.很多已经做案例的人,却不知 ...