c++ - dbus - 如何设置包含路径

标签 c++ ubuntu-12.04 dbus

在我的系统上,dbus header 位于 /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 header 中的路径?

最佳答案

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

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

Pkgconfig 包含链接器/编译器等的数据库。使用特定库所需的标志。请参阅 man pkg-config 了解更多信息。

关于c++ - dbus - 如何设置包含路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21602607/

相关文章:

qt - 学习 qt-dbus 的资源

c++ - 连接到不同计算机上的 session DBus

linux - ubuntu - make 后权限被拒绝

Linux BlueZ dbus 通信

c++ - 使用 giflib 段错误 C++ 提取帧

c++ - 为什么 "n"在此函数中没有递增?

linux - 在/目录中意外使用 rm -r * 后恢复 ubuntu

python - 确保我的程序没有执行并发文件写入

C++多菱形继承和纯虚函数

c++ - 在 C++ 中从 std::string 转换为 char *