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