2013-03-06 68 views
6

我一直在试图编译一个程序dbus,并建议我在代码中提到了类似的问题。我没有执行它,如图所示:D总线连接问题

gcc `pkg-config --cflags dbus-glib-1` \ 
    `pkg-config --cflags dbus-1` \ 
    `pkg-config --cflags glib-2.0` \ 
    dbus-example.c \ 
    `pkg-config --libs dbus-glib-1` \ 
    `pkg-config --libs dbus-1` \ 
    `pkg-config --libs glib-2.0` 

我仍然得到以下错误:

Package dbus-glib-1 was not found in the pkg-config search path. 
Perhaps you should add the directory containing `dbus-glib-1.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'dbus-glib-1' found 
Package glib-2.0 was not found in the pkg-config search path. 
Perhaps you should add the directory containing `glib-2.0.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'glib-2.0' found 
Package dbus-glib-1 was not found in the pkg-config search path. 
Perhaps you should add the directory containing `dbus-glib-1.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'dbus-glib-1' found 
Package glib-2.0 was not found in the pkg-config search path. 
Perhaps you should add the directory containing `glib-2.0.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'glib-2.0' found 

我安装了上述套餐,但仍继续发生错误。

回答

7

你安装了这些库的开发包,还是只安装了库本身?在Debian/Ubuntu上,您需要libdbus-glib-1-dev和其他类似的-dev包;在Fedora上,你需要dbus-glib-devel和类似的。