Ubuntu12.04LTS64-bit Qt4 terminal compilation environment

Source: Internet
Author: User
Use apt-get to install Qt4 in Ubuntu12.04. First: sudoapt-getinstalllibqt4-devlibqt4-dbglibqt4-guilibqt4-sqlqt4-dev-toolsqt4-docqt4-designerqt4-qtconfigSecond: Test personal instance create folder qt4hello (mkdi

Install Qt4 using apt-get In Ubuntu 12.04.

First: sudo apt-get install libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4-designer qt4-qtconfig

Second: test a personal instance

Create the folder qt4hello (mkdir qt4hello) ---> vim qthello. cpp ---> enter the following code:

# Include
# Include
Int main (int argc, char * argv [])
{
QApplication app (argc, argv );
QPushButton hello ("Hello ubuntu12.04 LTS! ");
Hello. resize (190,150 );
Hello. show ();
Return app.exe c ();
}

----> Save (: wq) ---> qmake-project (generate QT project) ---> qmake (generate makefile file) ---> make displays the following code

G ++-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 qthello. o qthello. cpp
G ++-m64-Wl,-O1-o qt4hello qthello. o-L/usr/lib/x86_64-linux-gnu-lQtGui-lQtCore-lpthread

--->./Qt4hello (Folder name)

Qt details: Click here
Qt: Click here

Recommended reading:

Install and configure http://www.linuxidc.com/Linux/2013-08/88539.htm in Gtk and QT compiling environment in Ubuntu

Building http://www.linuxidc.com/Linux/2013-07/87576.htm in QT environment in Linux

Ubuntu QT console program cannot run solution and XTerm configuration method http://www.linuxidc.com/Linux/2013-06/86244.htm

Ubuntu 10.04 QT4.7.4 porting detailed http://www.linuxidc.com/Linux/2013-01/77930.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

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.