Ubuntu12.04 install Qt (installed in software source)

Source: Internet
Author: User
Tags imagemagick

In another blog, I talked about downloading software from the official website to install Qt. However, in command line mode, the first example in a book cannot be implemented, it seems that the environment is not configured properly. It is said that the software installed in the software source does not need to configure the environment, it is estimated that the system is automatically configured during the installation, so this time I install Qt in the software source, the following describes how to install Qt in the software source.

wahaha@ubuntu-K55VD:~$ sudo apt-get install qtcreator[sudo] password for wahaha:
The information displayed during the installation process is as follows (from the content, it seems that there are some details in the case of 125-132 rows, but this does not affect us currently ).
[Sudo] password for wahaha: Reading the package list... the dependency tree of the software package being analyzed is reading status information... complete will install the following additional software packages: imagemagick-common liblqr-1-0 libmagickcore4 libmagickcore4-extra libmagickwand4 libnetpbm10 libqt4-declarative-gestures libqt4-declarative-particles libqt4-dev libqt4-help libqt4-opengl-dev libqt4-scripttools libqtwebkit-dev netpbm libqt4-test qt4-demos qt4-designer qt4-dev-tools qt4-doc- Tools qt4-qmake qt4-qmlviewer qtcreator-the software package recommended for doc installation: upload-doc autotrace curl enscript ffmpeg gimp gnuplot grads hp2xx html2ps libwmf-bin mplayer povray radiance texlive-base-bin transfig ufraw-batch drawing-dev libpq-dev libsqlite3-dev unixodbc-dev qt4-doc-html cmake git the following [new] software packages of the subversion will be installed: imagemagick-common liblqr-1-0 libmagickcore4 libmagickcore4-extra libmagickwan D4 libnetpbm10 libqt4-declarative-gestures libqt4-declarative-particles libqt4-dev libqt4-help libqt4-opengl-dev libqt4-scripttools libqt4-test libqtwebkit-dev netpbm qt4-demos qt4-designer qt4-dev-tools qt4-doc qt4-linguist-tools qt4-qmake qtcreator-doc has upgraded 0 software packages, 25 new software packages are installed, 0 software packages are to be uninstalled, and 0 software packages are not upgraded. Download the 138 MB/139 MB software package. After decompression, 254 MB of extra space is consumed. Do you want to continue? [Y/n] y get: 1 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libqt4-test amd64 4: 4. 8.1-0ubuntu4. 6 [60.2 kB] Get: 2 http://cn.archive.ubuntu.com/ubuntu/ precise/universe qtcreator amd64 2.4.1-0ubuntu2 [10.8 MB] Get: 3 http://cn.archive.ubuntu.com/ubuntu/ precise/universe qtcreator amd64 2.4.1-0ubuntu2 [10.8 MB] get: 4 http://cn.archive.ubuntu.com/ubuntu/ precise/universe qtcreator amd64 2.4.1-0 ubunt U2 [10.8 MB] Get: 5 http://cn.archive.ubuntu.com/ubuntu/ precise/universe qtcreator-doc all 2.4.1-0ubuntu2 [7,289 kB] get: 6 http://cn.archive.ubuntu.com/ubuntu/ precise/main liblqr-1-0 amd64 0.4.1-1.1 [39.5 kB] Get: 7 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main imagemagick-common all. 6.9.7-5ubuntu3. 3 [40.3 kB] Get: 8 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libmagickcor E4 amd64 8: 6. 6.9.7-5ubuntu3. 3 [1,879 kB] Get: 9 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libmagickwand4 amd64. 6.9.7-5ubuntu3. 3 [364 kB] Get: 10 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main imagemagick amd64. 6.9.7-5ubuntu3. 3 [49.2 kB] Get: 11 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libmagickcore4-extra amd64. 6.9.7-5ubuntu3. 3 [50.2 kB] Get: 12 http: // Cn.archive.ubuntu.com/ubuntu/ precise/main libnetpbm10 amd64 :10. 0-15 [67.5 kB] Get: 13 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libqt4-declarative-gestures amd64. 8.1-0ubuntu4. 6 [20.5 kB] Get: 14 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libqt4-declarative-particles amd64. 8.1-0ubuntu4. 6 [26.2 kB] Get: 15 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/ma In qt4-linguist-tools amd64. 8.1-0ubuntu4. 6 [827 kB] Get: 16 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-qmake amd64. 8.1-0ubuntu4. 6 [1,263 kB] Get: 17 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libqt4-dev amd64. 8.1-0ubuntu4. 6 [2,396 kB] Get: 18 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main libqt4-opengl-dev amd64. 8.1-0ubuntu4. 6 [22.8 kB] Get: 19 Http://cn.archive.ubuntu.com/ubuntu/ precise/main libqtwebkit-dev amd64 2.2.1-1ubuntu4 [22.8 kB] Get: 20 http://cn.archive.ubuntu.com/ubuntu/ precise/main netpbm amd64. 0-15 [1,312 kB] Get: 21 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-demos amd64. 8.1-0ubuntu4. 6 [9,879 kB] Get: 22 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-demos amd64. 8.1-0ubuntu4. 6 [9, 8 Get: 23 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-designer amd64. 8.1-0ubuntu4. 6 [344 kB] Get: 24 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-dev-tools amd64. 8.1-0ubuntu4. 6 [3,877 kB] Get: 25 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-dev-tools amd64. 8.1-0ubuntu4. 6 [3,877 kB] Get: 26 http://cn.archive.ubuntu.com/ubuntu/ precise-upd Ates/main qt4-dev-tools amd64. 8.1-0ubuntu4. 6 [3,877 kB] Get: 27 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 28 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 29 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 30 http://cn.archive.u Buntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 31 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 32 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 33 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 34 Http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 35 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 36 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 37 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0 ubunt U4.6 [97.4 MB] Get: 38 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 39 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 40 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 41 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-do C all 4: 4. 8.1-0ubuntu4. 6 [97.4 MB] Get: 42 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 43 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 44 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 45 http://cn.archive.ubuntu.com/ubuntu/ precise -Updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 46 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main qt4-doc all. 8.1-0ubuntu4. 6 [97.4 MB] Get: 47 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/universe qt4-qmlviewer amd64. 8.1-0ubuntu4. 6 [147 kB] Download 28.1 MB, time 1 hour 36 minutes 20 seconds (4,854 B/s) Selecting previusly unselected package libqt4-help. (Reading database... the system currently has 308619 files and contents installed .) Extracting libqt4-help (from... libqt4-help_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package libqt4-scripttools. extracting libqt4-scripttools (from... libqt4-scripttools_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package libqt4-test. extracting libqt4-test (from... libqt4-test_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previusly unselected package qtcreator. extracting qctl Eator (from... /qtcreator_2.4.1-0ubuntu2_amd64.deb )... selecting previusly unselected package qtcreator-doc. extracting qtcreator-doc (from... /qtcreator-doc_2.4.1-0ubuntu2_all.deb )... selecting previolet unselected package liblqr-1-0. extracting liblqr-1-0 (from... /liblqr-1-0_0.4.1-1.1_amd64.deb )... selecting previusly unselected package imagemagick-common. extracting imagemagick-common (from... imagemagick-common_8 % 3a6. 6.9.7-5ubuntu3. 3_all.deb )... selecting previusly unselected package libmagickcore4. Extracting libmagickcore4 (from... /libmagickcore4_8% 3a6. 6.9.7-5ubuntu3. 3_amd64.deb )... selecting previusly unselected package libmagickwand4. decompressing libmagickwand4 (from... /libmagickwand4_8% 3a6. 6.9.7-5ubuntu3. 3_amd64.deb )... selecting previusly unselected package imagemagick. extracting imagemagick (from... /imagemagick_8% 3a6. 6.9.7- 5ubuntu3. 3_amd64.deb )... selecting previolet unselected package libmagickcore4-extra. extracting libmagickcore4-extra (from... libmagickcore4-extra_8 % 3a6. 6.9.7-5ubuntu3. 3_amd64.deb )... selecting previusly unselected package libnetpbm10. decompressing libnetpbm10 (from... /libnetpbm10_2% 3a10. 0-15_amd64.deb )... selecting previolet unselected package libqt4-declarative-gestures. extracting libqt4-declarative-gestures (from ... Libqt4-declarative-gestures_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package libqt4-declarative-particles. extracting libqt4-declarative-particles (from... libqt4-declarative-particles_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package qt4-linguist-tools. extracting qt4-linguist-tools (from... qt4-linguist-tools_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previ Ously unselected package qt4-qmake. extracting qt4-qmake (from... qt4-qmake_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package libqt4-dev. extracting libqt4-dev (from... libqt4-dev_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package libqt4-opengl-dev. extracting libqt4-opengl-dev (from... libqt4-opengl-dev_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previusly unselected pa Ckage libqtwebkit-dev. extracting libqtwebkit-dev (from... /libqtwebkit-dev_2.2.1-1ubuntu4_amd64.deb )... selecting previusly unselected package netpbm. extracting netpbm (from... /netpbm_2% 3a10. 0-15_amd64.deb )... selecting previolet unselected package qt4-demos. extracting qt4-demos (from... qt4-demos_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package qt4-designer. extracting qt4-designer (from... qt4-des Igner_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package qt4-dev-tools. extracting qt4-dev-tools (from... qt4-dev-tools_4 % 3a4. 8.1-0ubuntu4. 6_amd64.deb )... selecting previolet unselected package qt4-doc. extracting qt4-doc (from... qt4-doc_4 % 3a4. 8.1-0ubuntu4. 6_all.deb )... selecting previolet unselected package qt4-qmlviewer. extracting qt4-qmlviewer (from... qt4-qmlviewer_4 % 3a4. 8.1-0ubuntu4. 6_amd 64. deb )... processing the trigger for man-db... processing the trigger for desktop-file-utils... processing the trigger for bamfdaemon... rebuilding/usr/share/applications/bamf. index... processing the trigger for gnome-menus... processing the trigger for shared-mime-info... unknown media type in type 'all/all' Unknown media type in type 'all/allfiles' Unknown media type in type 'uri/mms 'unknown media type in type 'uri/mmst' unknown media type in type 'uri/mmsu' Unknown media type In type 'uri/pnm 'unknown media type in type' uri/rtspt 'unknown media type in type' uri/rtspu' is processing the trigger for hicolor-icon-theme... setting libqt4-help (4: 4. 8.1-0ubuntu4. 6 )... setting libqt4-scripttools (4: 4. 8.1-0ubuntu4. 6 )... setting libqt4-test (4: 4. 8.1-0ubuntu4. 6 )... setting qtcreator (2.4.1-0ubuntu2 )... setting qtcreator-doc (2.4.1-0ubuntu2 )... setting liblqr-1-0 (0.4.1-1.1 )... setting imagemagick-common (8: 6. 6.9.7-5ub Untu3.3 )... setting libmagickcore4 (8: 6. 6.9.7-5ubuntu3. 3 )... setting libmagickwand4 (8: 6. 6.9.7-5ubuntu3. 3 )... setting imagemagick (8: 6. 6.9.7-5ubuntu3. 3 )... setting libmagickcore4-extra (8: 6. 6.9.7-5ubuntu3. 3 )... setting libnetpbm10. 0-15 )... setting libqt4-declarative-gestures (4: 4. 8.1-0ubuntu4. 6 )... setting libqt4-declarative-particles (4: 4. 8.1-0ubuntu4. 6 )... setting qt4-linguist-tools (4: 4. 8.1-0ubuntu4. 6 )... update -Alternatives: Use/usr/bin/lupdate-qt4 to provide/usr/bin/lupdate (lupdate) in automatic mode. Update-alternatives: Use/usr/bin/lrelease-qt4 to provide/usr/bin/lrelease (lrelease) in automatic mode. Setting qt4-qmake (4: 4. 8.1-0ubuntu4. 6 )... update-alternatives: Use/usr/bin/qmake-qt4 to provide/usr/bin/qmake (qmake) in automatic mode. Setting libqt4-dev (4: 4. 8.1-0ubuntu4. 6 )... update-alternatives: Use/usr/bin/moc-qt4 to provide/usr/bin/moc (moc) in automatic mode. Update-alternatives: Use/usr/bin/uic-qt4 to provide/usr/bin/uic (uic) in automatic mode. Update-alternatives: Warning: Skip creating/usr/share/man/man1/uic.1.gz because the associated file/usr/share/man/man1/uic-qt4.1.gz (located in the linked group uic) does not exist. Setting libqt4-opengl-dev (4: 4. 8.1-0ubuntu4. 6 )... setting libqtwebkit-dev (2.2.1-1ubuntu4 )... setting netpbm. 0-15 )... setting qt4-demos (4: 4. 8.1-0ubuntu4. 6 )... setting qt4-designer (4: 4. 8.1-0ubuntu4. 6 )... update-alternatives: Use/usr/bin/designer-qt4 to provide/usr/bin/designer (designer) in automatic mode. Setting qt4-dev-tools (4: 4. 8.1-0ubuntu4. 6 )... update-alternatives: Use/usr/bin/assistant-qt4 to provide/usr/bin/assistant in automatic mode. Update-alternatives: Use/usr/bin/linguist-qt4 to provide/usr/bin/linguist (linguist) in automatic mode. Setting qt4-doc (4: 4. 8.1-0ubuntu4. 6 )... setting qt4-qmlviewer (4: 4. 8.1-0ubuntu4. 6 )... processing the trigger for libc-bin... ldconfig deferred processing now taking placewahaha @ ubuntu-K55VD :~ $

Then, log out and write a simple code for testing.

Wahaha @ ubuntu-K55VD :~ $ Cd Zhuo_Mian/QT code wahaha @ ubuntu-K55VD :~ /Zhuo_Mian/QT code $ lshello_1.cppwahaha @ ubuntu-K55VD :~ /Zhuo_Mian/QT code $ qmake-projectwahaha @ ubuntu-K55VD :~ /Zhuo_Mian/QT code $ lshello_1.cpp QT. prowahaha @ ubuntu-K55VD :~ /Zhuo_Mian/QT code $ qmake QT. pro wahaha @ ubuntu-K55VD :~ /Zhuo_Mian/QT code $ lshello_1.cpp Makefile QT. prowahahaha @ ubuntu-K55VD :~ /Samples/QT code $ makeg ++-c-m64-pipe-O2-Wall-W-D_REENTRANT-DQT_WEBKIT-DQT_NO_DEBUG-DQT_GUI_LIB-DQT_CORE_LIB-DQT_SHARED-I/usr/share/ qt4/mkspecs/linux-g ++-64-I. -I/usr/include/qt4/QtCore-I/usr/include/qt4/QtGui-I/usr/include/qt4-I. -I. -o hello_1.o hello_1.cppg ++-m64-Wl,-O1-o QT hello_1.o-L/usr/lib/x86_64-linux-gnu-lQtGui-lQtCore-lpthread wahaha @ ubuntu-K55VD :~ /Zhuo_Mian/QT code $ lshello_1.cpp hello_1.o Makefile QT. prowahaha @ ubuntu-K55VD :~ /Zhuo_Mian/QT code $./QT

Hello. cpp source code and running effect (I wrote a hello under the/home/wahaha/Zhuo_Mian/QT code. cpp file. At that time, I put both the code in the book in it, and the result compilation was wrong. So I put only one file under a folder, except for the case where the file is split, A project has multiple files. In addition, my QT code folder is a link Folder whose target file is not a Chinese name ).
#include <QApplication>#include <QLabel>int main(int argc, char *argv[]){QApplication app(argc,argv);QLabel *label = new QLabel("hello Qt!");label->show();return app.exec();}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.