dbus - 如何设置包括路径 [英] dbus - how to set include paths

查看:453
本文介绍了dbus - 如何设置包括路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的系统上,dbus头位于 /usr/include/dbus-1.0/dbus / dbus-arch-deps.h 是其他位置(似乎很奇怪): /usr/lib/x86_64-linux-gnu/dbus-1.0/include/dbus/dbus-arch-deps.h 在我的程序中,我包括#include< dbus-1.0 / dbus / dbus.h> ,但在每个包括其他路径的头文件看起来像这样: #include< dbus / xxx.h> 我可以将 dbus-arch-deps.h 复制到 /usr/include/dbus-1.0/dbus/ 但是如何修复dbus头文件中的路径?

On my system dbus headers are placed in /usr/include/dbus-1.0/dbus/ and dbus-arch-deps.h is other location (what seems to be strange): /usr/lib/x86_64-linux-gnu/dbus-1.0/include/dbus/dbus-arch-deps.h In my program I include #include<dbus-1.0/dbus/dbus.h>but in every header file which include others path looks like this: #include<dbus/xxx.h> I can copy dbus-arch-deps.h to /usr/include/dbus-1.0/dbus/ but how to fix paths in dbus headers ?

推荐答案

您的系统可能已安装pkg-config。

Your system likely has pkg-config installed.

g++ $(pkg-config --cflags dbus-1) main.c

Pkgconfig包含一个链接器/编译器等数据库。使用特定库所需的标志。有关详细信息,请参阅 man pkg-config

Pkgconfig contains a database of linker/compiler/etc. flags that are required to use specific libraries. See man pkg-config for more info.

这篇关于dbus - 如何设置包括路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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