我一直在尝试为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 我安装了上面提到的包,但错误仍然存在。
发布于 2013-03-07 16:37:54
您是否安装了这些库的开发包,或者只是安装了库本身?在Debian/Ubuntu上,你需要为其他人提供libdbus-glib-1-dev和类似的-dev包;在Fedora上,你需要dbus-glib-devel和类似的包。
https://stackoverflow.com/questions/15239560
复制相似问题