D-Bus连接问题

时间:2013-03-06 05:21:24

标签: linker-errors dbus pkg-config

我一直在尝试编译dbus的程序,正如我在代码中提到的那样,提到了类似的问题。我按照所示执行了它:

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 

我安装了上面提到的软件包,但仍然存在错误。

1 个答案:

答案 0 :(得分:14)

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