下载源码地址: Qt官方下载
编译源码
- 解压下载的压缩包,进入文件夹qt-everywhere-opensource-src-4.7.4
- ./configure -prefix /home/Qt4.7.4 -dbus
- 上面指令是指定了安装目录通过-prefix和添加dbus模块
- 接下来根据提示输入’o’, "yes"即可通过
- 如果配置成功,根据提示输入make进行编译(很长时间),编译成功后,输入make-install安装
编译问题
The QtDBus module cannot be enabled because libdbus-1 version 0.93 was not found
需要安装:
sudo apt-get install libdbus-1-dev
sudo apt-get install libedbus-dev
…/…/include/QtCore/…/…/src/corelib/tools/qmap.h: In instantiation of ‘T& QMap<Key, T>::operator[](const Key&) [with Key = int; T = inotify_event]’:
io/qfilesystemwatcher_inotify.cpp:364:33: required from here
…/…/include/QtCore/…/…/src/corelib/tools/qmap.h:531:45: error: value-initialization of incomplete type ‘char []’
node = node_create(d, update, akey, T());
编译器版本不匹配,qt4.7.4版本过老了,使用低版本的gcc,g++(推荐gcc 5.4)
gcc下载地址