找不到包的话就要学会用pkg-config命令。例如,我在程序中有#include <dbus/dbus-lib.h>, 但是编译通不过,于是可以这样做:
airead@airead:~/study/dbus/demo$ pkg-config --list-all | grep dbus
dbus-glib-1 dbus-glib - GLib integration for the free desktop message bus
dbus-1 dbus - Free desktop message bus
dbus-python dbus-python - Python bindings for D-Bus
airead@airead:~/study/dbus/demo$ pkg-config --cflags dbus-glib-1
-pthread -I/usr/include/dbus-1.0 -I/usr/lib/i386-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include