Installation and use of Qt Creator under CentOS
Qt, with its open source, free, fully object-oriented (easy to scale), allows for a growing number of developers who have the benefits of real component programming and portability across platforms. Qt Creator is an official Nokia-launched IDE for QT development. This article introduces the installation of Qt Creator under Linux, and gives a Hello world class example for the use of Qt Creator, hoping to play a role in the first contact with Qt Creator's friends.
Qt Creator Installation
1.Ready to
Download and install QT (for QT compilation and installation configuration, please refer to the author's previous blog, "Linux compile and install the full QT process").
2.View
Check your computer system situation, terminal input command:
Uname-a
The author is x86_64 Gnu/linux.
3.Download
To Qt's official website to download the QT Creator with its own computer, address is http://qt.nokia.com/downloads. The most recent version of Qt Creator is 1.3.0, and the author chooses the QT Creator 1.3.0 Binary for linux/x11 64-bit (MB).
4.installation
After downloading, get the size 47.2 Mb installation file Qt-creator-linux-x86_64-opensource-1.3.0.bin, installed on Linux as follows:
chmod u+x./qt-creator-linux-x86_64-opensource-1.3.0.bin
./qt-creator-linux-x86_64-opensource-1.3.0.bin
At this point, start the setup Qt Creator Welcome Installation dialog box and click "Next"->
Protocol licensing interface, select "I Accept the Agreement", click "Next"->
Select the Qt Creator installation Directory dialog box. The author chooses/home/defonds/tools/qtcreator/qtcreator-1.3.0 and clicks "Next"->
To install the interface, click "Next"->
At the end of the installation, click Finish.
5. Configuration:
Configure environment variables. Use Vim ~/.BRASHRC to add the following environment variables:
#***********************qt creator**********************
Export qtcdir=/home/elecyz/tools/qt5.1.1/tools/qtcreator/
Export path= $QTCDIR/bin: $PATH
Export manpath= $QTCDIR/man: $MANPATH
Export ld_library_path= $QTCDIR/lib: $LD _library_path
This allows you to use the Qtcreator command every time you need a QT creator.
But there was a problem with my installation.
Failed to load Core:/home/elecyz/tools/qt5.1.1/tools/qtcreator/lib/qtcreator/plugins/qtproject/libcore.so:cannot Load library/home/elecyz/tools/qt5.1.1/tools/qtcreator/lib/qtcreator/plugins/qtproject/libcore.so: (/usr/lib64/ Libstdc++.so.6:version ' glibcxx_3.4.15 ' not found (required by/home/elecyz/tools/qt5.1.1/tools/qtcreator/lib/ qtcreator/plugins/qtproject/.. /.. /./libqt5clucene.so.5))
Say there's no ' glibcxx_3.4.15 ' in my libstdc++.so.6.
Use the following instructions
$ strings/usr/lib/libstdc++.so.6 | grep GLIBC
Get:
glibcxx_3.4
glibcxx_3.4.1
glibcxx_3.4.2
glibcxx_3.4.3
glibcxx_3.4.4
glibcxx_3.4.5
glibcxx_3.4.6
glibcxx_3.4.7
glibcxx_3.4.8
glibcxx_3.4.9
glibcxx_3.4.10
glibcxx_3.4.11
glibcxx_3.4.12
glibcxx_3.4.13
glibc_2.0
glibc_2.3
glibc_2.4
glibc_2.1
glibc_2.1.3
glibc_2.3.2
glibc_2.2
Glibcxx_force_new
Glibcxx_debug_message_length
I really did not glibcxx_3.4.15, online search said that my GCC version is older.
Solutions found online: Solution:compile gcc-4.6.2 with--prefix=/usr/local/gcc462/,
Copy libstdc++.so.6.0.16 to/usr/lib64/,
And make a new symlink libstdc++.so.6 to libstdc++.so.6.0.16
I use GCC--version, and my gcc is
GCC (gcc) 4.4.7 20120313 (Red Hat 4.4.7-3)
So it really needs to be upgraded, and then I'm going to upgrade GCC, and to be sure, I experimented on the virtual machine first.
1. Download the source package
wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2
Decompression: TAR-JXVF gcc-4.8.0.tar.bz2
2. Download the required libraries for compiling
CD gcc-4.8.0
./contrib/download_prerequisites
Cd..
3. Build the compilation output directory
mkdir gcc-build-4.8.0
4. Enter this directory and execute the following command to generate the makefile file
CD gcc-build-4.8.0
$PWD. /gcc-4.8.0/configure--enable-checking=release--enable-languages=c,c++--disable-multilib
5. Compile
Make-j4
If the compilation is successful, then the time is relatively long, half an hour or so, so if you look at it has been in the output did not stop immediately, should be very happy.
6. Installation
sudo make install
7. Switch GCC to new
Determine the path of the newly installed GCC, generally by default under/usr/local/bin. Can updatedb first, then locate Gcc-4.8|tail find
Ls/usr/local/bin | grep gcc
Add new gcc to optional, the last third is the name, the penultimate parameter is the new GCC path, the final parameter 40 is the priority, and a larger number is automatically used later.
Update-alternatives--INSTALL/USR/BIN/GCC GCC/USR/LOCAL/BIN/I686-PC-LINUX-GNU-GCC 40
8. Confirm that the current version has been switched to new
Gcc-v
I am here with ssh remote, found that the version has not changed, disconnected from the training, regenerated session after the discovery became 4.8.
9 Replace the libstdc++.so.6 under Usr/lib with the libstdc++.so.6 under Usr/local/lib