CentOS 6.5 QtCreator启动时 dbus-1的错误解决方法
启动QtCreator提示:dbus_connection_can_send_type的错误,
QString::arg: Argument missing: 无法解析dbus_connection_can_send_type中的符号“dbus_connection_can_send_type”:
dbus-1, (/lib/libdbus-1.so.3: undefined symbol: dbus_connection_can_send_type)
解决办法:
更新dbus版本来解决..
首先去https://www.freedesktop.org/wiki/Software/dbus/#index4h1 下载dbus的最新版本(1.10)
解压后,进入 文件夹:dbus-1.10.0运行如下命令:
./configure
make
make install
{注意:
在执行./config时会出现如下错误:
checking for XML_ParserCreate_MM in -lexpat... no configure: error: Explicitly requested expat but expat not found
说明D-Bus daemon需要expat XML parser 库,所以这里需要先编译expat库:
从https://sourceforge.net/projects/expat/?source=typ_redirect下载expat-2.1.1
解压后,进入 文件夹运行如下命令:
./configure
make
make install
}
安装完成,更新连接文件
把 /usr/local/lib/libdubs-1.so.3.14.3 复制到 /lib (我的是32位)
在 /lib下 删除libdbus-1.so和libdbus-1.so.3 两个文件,并为libdubs-1.so.3.14.3创建连接:
ln -s libdubs-1.so.3.14.3 libdbus-1.so
ln -s libdubs-1.so.3.14.3 libdbus-1.so.3
再次启动QtCreator,显示错误:
process 14950: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/etc/machine-id": 没有那个文件或目录
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a bactrace
已放弃(core dumped)
缺少machine-id文件,需要给它定义一个id,使用dbus-uuidgen创建id文件
dbus-uuidgen >/usr/var/lib/dbus/machine-id cp /usr/var/lib/dbus/machine-id /etc/
或者
dbus-uuidgen >/etc/machine-id
该问题解决,启动QtCreator,没有任何错误提示