在我的系统上,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/