运行Qt5.12时遇到的错误及解决方法
2.1 报错:undefined symbol: FT_Get_Font_Format
1)运行Qt5.12的qtcreator时报错
$ ./Qt5.12.4/Tools/QtCreator/bin/qtcreator
./Qt5.12.4/Tools/QtCreator/bin/qtcreator: symbol lookup error:
/home/workspace/Qt5.12.4/Tools/QtCreator/lib/Qt/plugins/platforms/../..
/lib/libQt5XcbQpa.so.5: undefined symbol: FT_Get_Font_Format
2)解决方法
安装最新的libfreetype
源码下载地址:
http://download.savannah.gnu.org/releases/freetype/
选择最新的版本freetype-2.10.0.tar.bz2: http://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.bz2
拷贝到ubuntu14.04中,执行以下步骤,编译、安装freetype-2.10.0
$ mkdir freetype //freetype-2.10.0的安装目录
$ tar -xf freetype-2.10.0.tar.bz2
$ cd freetype-2.10.0
$ ./configure --prefix=/home/workspace/tools/freetype
$ make
$ make install
设置环境变量
$ cd ~
$ vi .bashrc
#添加:
export LD_LIBRARY_PATH=/home/workspace/tools/freetype/lib:$LD_LIBRARY_PATH
注意:将/home/workspace/tools/freetype/lib目录放在前面,以屏蔽 /usr/lib/x86_64-linux-gnu/ 目录下的 libfreetype.so.6
再次运行报错:symbol dbus_message_get_allow_interactive_authorization, version LIBDBUS_1_3 not defined in file libdbus-1.so.3 with link time reference
1)运行Qt5.12的qtcreator报错:
$ ./Qt5.12.4/Tools/QtCreator/bin/qtcreator
./Qt5.12.4/Tools/QtCreator/bin/qtcreator: relocation error:
/home/workspace/Qt5.12.4/Tools/QtCreator/lib/Qt/plugins/platforms/../../
lib/libQt5DBus.so.5: symbol dbus_message_get_allow_interactive_authorization,
version LIBDBUS_1_3 not defined in file libdbus-1.so.3 with link time reference
2)解决方法
安装最新的libdbus库
源码下载地址
https://dbus.freedesktop.org/releases/dbus/
选择libdbus.1.13.8下载: https://dbus.freedesktop.org/releases/dbus/dbus-1.13.8.tar.xz
拷贝到ubuntu14.04中,执行以下步骤,编译、安装dbus-1.13.8.tar.xz
$ mkdir dbus //dbus-1.13.8的安装目录
$ tar -xf dbus-1.13.8.tar.xz
$ cd dbus-1.13.8
$ ./configure --prefix=/home/workspace/tools/dbus
$ make
$ make install
设置环境变量
$ cd ~
$ vi .bashrc
#添加:
export export LD_LIBRARY_PATH=/home/workspace/tools/dbus/lib:$LD_LIBRARY_PATH
注意:将/home/workspace/tools/dbus/lib目录放在前面,以屏蔽 /usr/lib/x86_64-linux-gnu/ 目录下的 libdbus-1.so.3