dbus - 如何设置包含路径

Irb*_*bis 2 c++ dbus ubuntu-12.04

在我的系统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报头的路径?

WGH*_*WGH 6

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

g++ $(pkg-config --cflags dbus-1) main.c
Run Code Online (Sandbox Code Playgroud)

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