This article mainly introduces the installation of Linux system Ubuntu12.04 (64bit) under Qt4.8.5, which also involves the installation of Fedora9 under QT4.
1, download software : Go to Qt's official website download Qt4.8.5 and QT Creator software , download the specific software as follows:
- Qt4.8.5 Software: qt-everywhere-opensource-src-4.8.5.tar.gz
- Qt Creator Software: qt-creator-linux-x86_64-opensource-2.5.2.bin
2, decompression qt-everywhere-opensource-src-4.8.5.tar.gz, can be extracted to the current directory:
sudo tar xvzf qt-everywhere-opensource-src-4.8. 5. tar. gz
3, compile the configuration Qt4.8.5: Enter the qt-everywhere-opensource-src-4.8.5 directory, the compilation configuration:
./configure
Ubuntu12.04 (64bit) configuration error, because the pure version of Ubuntu is not g++, need to install first:
sudo Install g++
Compiling again will cause errors, similar to the following:
Basic XLIB functionality Test failed! in/home/gcgily/qt-everywhere-opensource-src-4.8. 2/mkspecs/linux-g++
Or
g++-wl,-o1-o xlib xlib.o -l/usr/x11r6/lib-lxext-lx11-lm /usr/bin/ldFind - Lxext
At this point, you need to install the Libx11-dev Libxext-dev libxtst-dev three packages:
sudo Install Libx11-dev libxext-dev Libxtst-dev
After the installation is complete, execute the./configure to compile successfully.
4. Make: Execute. After successful/configure, there will be a next hint: Execute make and do install ( prompt gmake and gmake install in Fedora9), at which point we execute:
Make
It will take a long time to wait for the run to complete.
5, make install: Execute the Make install command, this time requires root user rights support:
sudo Make Install
It will also take a long time.
6. Set Environment variables : Add the following script to the current user. bashrc file:
################### Setting the QT environment variable ############### #export PATH= $PATH:/usr/local/trolltech/qt-4.8 . 5/bin:/usr/local/trolltech/qt-4.8. 5/includeexport qtdir=/usr/local/trolltech/qt-4.8. 5
Then, update the. bashrc file:
source. BASHRC
at this point, Qt4.8.5 Software Installation is complete.
7. Installing QT Creator software : Qt-creator-linux-x86_64-opensource-2.5.2.bin
1) Change the operation permissions of the Qt-creator-linux-x86_64-opensource-2.5.2.bin, that is, increase the execution permissions:
sudo chmod +x qt-creator-linux-x86_64-opensource-2.5. 2. bin
2) Run the installation file: Qt-creator-linux-x86_64-opensource-2.5.2.bin
sudo ./qt-creator-linux-x86_64-opensource-2.5. 2. bin
8, configure QT Creator: So far, installed Qt4.8.5 and QT Creator software, also need to configure QT Creator in QT version, so as to normal use.
Report:
Qt Creator shortcut keys:
F1 View Help F2 jump to function definition (Ctrl+ left mouse button) shift+F2 between declaration and definition toggle between F4 header file and source file Ctrl+ Space Auto-Complete Ctrl+B Compile Project Ctrl+R Run ProjectCtrl +I auto-align Ctrl+/ Comment Line/uncomment line Ctrl+shift+< collapse code block CTRL+shift+> expand code block F5 Start Debugging shift+F5 stop Debugging F9 set and cancel breakpoints F10 step forward F11+ F11 Step out function
conclusion, hope to Bo friends have some help, haha ...
Ubuntu12.04 (64bit) Installation QT4 summary