11

我一直在尝试编译一个程序,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 

我安装了上述软件包,但错误仍然存​​在。

4

1 回答 1

23

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

于 2013-03-07T08:37:54.050 回答