Recently doing about process migration project, need to use qt interface to do the project, according to the Internet to find information to do a bit summary, the record about the whole process of installation and configuration qt under linux.
1 , the source code (there are many online tutorials, as earlier, so that some link has expired, here's a link is valid today tried)
src Download the official website address: ftp: //ftp.qt.nokia.com / qt / Source /
2009 Nian 10 Yue 1 release of qt-x11-opensource-src- 4.5.3.tar.gz, size 122 Mb.
2, the decompression
tar xvfz qt-x11-opensource- src-4.5.3.tar.gz
3, produce the makefile
./configure
this time he will ask you: "Which edition of Qt do you want to use?"
And then give you a choice of two types:
Type 'c' IF you want to use at The Commercial's Edition.
Type 'o' if you want to use the Open Source Edition.
The first is the commercial version, the second is the free version.
Select the 'o' (Qt / Embedded Free Edition is the embedded version of Qt to develop free software provided).
At this time, permission interface.
'Yes' to accept the license agreement.
Start generating the makefile. This takes about 5-10 minutes.
4. Qt compilation
gmake
this process a long time, takes about two hours.
5. Installation Qt
run gmake install
default installation /usr/local/Trolltech/Qt-4.5.3 to
about 5 - 10 mins. Ends normally installed.
Run /usr/local/Trolltech/Qt-4.5.3/bin/designer, saw the start qt, qt that is installed.
6. Set Environment Variables
One. Modify the user environment variables
we /home/juan/.bashrc
Finally, add the following information in its
export QTDIR=/usr/local/Trolltech/Qt-4.5.3
export PATH=$QTDIR/bin:$PATH
export MANPATH=$QTDIR/man:$MANPATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
two. Modify environment variables for all users
vi / etc / profile
and finally add the following information in its
Export the QTDIR = / usr / local / Trolltech / the Qt-4.5.3
Export $ the QTDIR the PATH = / bin: $ the PATH
Export the QTDIR your MANPATH = $ / man: $ your MANPATH
Export the LD_LIBRARY_PATH = $ QTDIR / lib: $ LD_LIBRARY_PATH
Third, the test
Re-open a terminal, enter the command:
qmake -v
Output:
Version 2.01a QMake
the Using Qt Version 4.5.3 in /usr/local/Trolltech/Qt-4.5.3/lib
enter the command:
which qmake
Output:
/usr/local/Trolltech/Qt-4.5.3/bin/qmake
Proof Qt environment variable has been configured successfully
Installation problems encountered in the process:
(1)
“Project ERROR: Package gstreamer-app-0.10 not found.”
Solution :
yum install 'pkgconfig(gstreamer-app-0.10)'
I use wget command to download the source code needed.
> mkdir ~/qt-downloads
> cd ~/qt-downloads
> wget http://download.qt-project.org/official_releases/qtcreator/2.8/2.8.1/qt-creator-linux-x86-opensource-2.8.1.run
qt-creator-linux-x86-opensource-2.8.1.run 就被下载到了 ~/qt-downloads 路径下。
2.2 修改文件权限
修改该文件的权限,使之有执行权限。
> chmod u+x qt-creator-linux-x86-opensource-2.8.1.run
2.3 安装
执行bin文件开始安装Qt Create
> sudo ./qt-creator-linux-x86-opensource-2.8.1.run
其期,安装向导会询问安装路径,我是把文件安装到 /usr/local/ 目录下的。
完成安装之后,Applications --> Programming 菜单下就有一个 Qt Creator 的入口。点击会弹出Qt Creator 的界面
运行./qtcreator 会出现
(/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by/opt/Qt4.5.3/Tools/QtCreator/lib/qtcreator/plugins/QtProject/../.././libQt4CLucene.so.6))
缺少`GLIBCXX_3.4.14' 需要升级gcc,更新至gcc-4.8.2
1、wget http://www.netgull.com/gcc/releases/gcc-4.8.2/gcc-4.8.2.tar.gz