Qt4.8.5 开发环境搭建【完整流程】关于编译出现的问题,我另开一贴再次解决。
1.首先在 ubuntu10.04 系统的/home/ye 目录中,创建一个 Qt 文件夹,复制文件qt-everywhere-opensource-src-4.8.5.tar.gz 到 Qt 文件夹中,并且解压:
$ tar –zxvf qt-everywhere-opensource-src-4.8.5.tar.gz
2. 编译 qt 需要 g++,在终端输入 g++-v,如果出现如下图所示,说明已经安装了 g++,否则执行命令来
安装 g++:
$ sudo apt-get install g++
安装成功:
[email protected]:~/Qt$ g++ -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion=‘Ubuntu 4.4.3-4ubuntu5.1‘ --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1) [email protected]:~/Qt$
再安装所需的三个包:
[email protected]:~/Qt$ sudo apt-get install libX11-dev libXext-dev libXtst-dev
$ sudo apt-get install libX11-dev libXext-dev libXtst-dev
…………现象
正在设置 x11proto-xext-dev (7.1.1-2) ... 正在设置 libxext-dev (2:1.1.1-2ubuntu0.1) ... 正在设置 libxi6 (2:1.3-3ubuntu0.2) ... 正在设置 libxi-dev (2:1.3-3ubuntu0.2) ... 正在设置 libxtst6 (2:1.1.0-2ubuntu0.1) ... 正在设置 x11proto-record-dev (1.14-2) ... 正在设置 libxtst-dev (2:1.1.0-2ubuntu0.1) ... 正在处理用于 libc-bin 的触发器... ldconfig deferred processing now taking place
安装成功 。
3. 进入刚刚解压的 qt 源码目录中:cd qt-everywhere-opensource-src-4.8.5/; 执行./configure, 出现如下图所
示,选择开源版本
[email protected]:~/Qt/qt-everywhere-opensource-src-4.8.5$ ./configure Which edition of Qt do you want to use ? Type ‘c‘ if you want to use the Commercial Edition. Type ‘o‘ if you want to use the Open Source Edition. o This is the Open Source Edition. You are licensed to use this software under the terms of the Lesser GNU General Public License (LGPL) versions 2.1. You are also licensed to use this software under the terms of the GNU General Public License (GPL) versions 3. Type ‘3‘ to view the GNU General Public License version 3. Type ‘L‘ to view the Lesser GNU General Public License version 2.1. Type ‘yes‘ to accept this license offer. Type ‘no‘ to decline this license offer. Do you accept the terms of either license? yes ……………………
Qt is now configured for building. Just run ‘make‘. Once everything is built, you must run ‘make install‘. Qt will be installed into /usr/local/Trolltech/Qt-4.8.5 To reconfigure, run ‘make confclean‘ and ‘configure‘.4.编译源码,执行make如果安装成功,则生成makefile ,如果没有正常生成请看 另一帖:Qt4.8.5 开发环境搭建【编译出现的问题】[email protected]:~/Qt/qt-everywhere-opensource-src-4.8.5$ ls bin configure.exe INSTALL Makefile src changes-4.8.5 demos LGPL_EXCEPTION.txt mkspecs templates config.profiles doc lib plugins tools config.status examples LICENSE.FDL projects.pro translations config.tests imports LICENSE.GPL3 qmake util configure include LICENSE.LGPL README
在这里就看出了已经生成了makefile了,执行
[email protected]:~/Qt/qt-everywhere-opensource-src-4.8.5$ make
这个过程时间有点长,耐心等待。
5.完成编译后安装
时间: 2024-10-12 20:55:28