Tuesday, August 12, 2014

Simple setting for QT4 development environment

Welcome document

1) $ sudo apt-get install libqt4-core

2) $ sudo apt-get install libqt4-dev

3) $ dpkg -l | grep qt4 Check QT4 development environment

ii  libntrack-qt4-1                       016-1.1                                       amd64        Qt 4 API for ntrack
ii  libpoppler-qt4-4:amd64                0.24.3-0ubuntu1~saucy1                        amd64        PDF rendering library (Qt 4 based shared library)
ii  libqt4-core                           4:4.8.4+dfsg-0ubuntu18.1                      amd64        transitional package for Qt 4 core non-GUI runtime libraries
ii  libqt4-dbus:amd64                     4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 D-Bus module
ii  libqt4-declarative:amd64              4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 Declarative module
ii  libqt4-designer:amd64                 4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 designer module
ii  libqt4-dev                            4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 development files
ii  libqt4-dev-bin                        4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 development programs
ii  libqt4-help:amd64                     4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 help module
ii  libqt4-network:amd64                  4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 network module
ii  libqt4-opengl:amd64                   4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 OpenGL module
ii  libqt4-opengl-dev                     4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 OpenGL library development files
ii  libqt4-qt3support:amd64               4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 3 compatibility library for Qt 4
ii  libqt4-script:amd64                   4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 script module
ii  libqt4-scripttools:amd64              4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 script tools module
ii  libqt4-sql:amd64                      4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 SQL module
ii  libqt4-sql-mysql:amd64                4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 MySQL database driver
ii  libqt4-svg:amd64                      4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 SVG module
ii  libqt4-test:amd64                     4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 test module
ii  libqt4-xml:amd64                      4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 XML module
ii  libqt4-xmlpatterns:amd64              4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 XML patterns module
ii  qt4-linguist-tools                    4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 Linguist tools
ii  qt4-qmake                             4:4.8.4+dfsg-0ubuntu18.1                      amd64        Qt 4 qmake Makefile generator tool

If you can see it as above, it’s completed.

QT4 Development Simple Test

4-1) $ mkdir qt-test

4-2) $ cd qt-test

4-3) $ vi test.cpp

#include <QtCore/QCoreApplication>
 #include <QDebug>

 int main(int argc, char *argv[])
 {
              //QCoreApplication a(argc, argv);
              qDebug() << "hello world!" << endl;
                  //return a.exec();
  }

4-4) $ qmake-qt4 -project Create file ‘qt-test.pro’

4-5) $ qmake-qt4 Create file ‘Makefile’

4-6) $ make make and then you can see binary file ‘qt-test’

4-7) $ ./qt test just run it.

etc : problem & solution

  • a problem : after ‘make’ command
make: Warning: File `/usr/share/qt4/mkspecs/linux-g++/qmake.conf' has modification time 1.4e+09 s in the future
/usr/bin/qmake-qt4 -o Makefile qt.pro
make: Warning: File `/usr/share/qt4/mkspecs/linux-g++/qmake.conf' has modification time 1.4e+09 s in the future
/usr/bin/qmake-qt4 -o Makefile qt.pro
make: Warning: File `/usr/share/qt4/mkspecs/linux-g++/qmake.conf' has modification time 1.4e+09 s in the future
/usr/bin/qmake-qt4 -o Makefile qt.pro
make: Warning: File `/usr/share/qt4/mkspecs/linux-g++/qmake.conf' has modification time 1.4e+09 s in the future
/usr/bin/qmake-qt4 -o Makefile qt.pro
…
repeat output as above.
  • a solution : $ find {directory_name} -exec touch {} \;

I don’t know exactly the reason of this problem but it is about date of system? file?
$ touch /usr/share/qt4/mkspecs/linux-g++/qmake.conf wasn’t able to solve this problem.
So I solved it by the command line which can run ‘touch’ in all of subdirectories as above.

No comments:

Post a Comment