Translations of this page:
This is an old revision of the document!
About this Article
1.install qtcreator
sudo apt-get install qtcreator
2.download QT lib from http://qt-project.org/downloads, in this guide use below
3. install lib
sudo apt-get install mesa-common-dev freeglut3 freeglut3-dev libqglviewer-dev-common
4. configure QT lib
mkdir -p /usr/local/qt/ ./configure -no-pch -opengl --prefix=/usr/local/qt/
5. compile and install
make make install
The compile process will use several hours,please be patient.
After compiled ,enter examples/widgets/wiggly/,there is some sample code you can use .Like below
CALCULATOR
TETRIS
6.set up the environment variables
add two line in the end of file /etc/profile
PATH="$PATH:/usr/local/qt/bin" export PATH
1.build a directory named hello ,create a new file named hello.cpp in it .
#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 ();
}
2. compile the hello.cpp
qmake -project qmake make
In current directory create a executable file,run it as like below