Cross-compile Qt applications

  • Configure the PC environment:
    $ export QT_PREFIX=/opt/qt-4.8.5
    $ export PATH=${QT_PREFIX}/bin:$PATH
    $ export QMAKESPEC=${QT_PREFIX}/mkspecs/qws/linux-arm-g++
  • Creating Code:
    $ mkdir hellomyir
    $ cd hellomyir
    $ gedit hellomyir.cpp

Enter the following code:

    #include <QApplication>
    #include <QLabel>
    int main(int argc, char **argv)
    {
    QApplication app(argc,argv);
    QLabel label("Make Your idea Real!");
    label.show();
    return app.exec();
    }
  • Build:
    $ qmake -project
    $ qmake
    $ make
  • Copy the “hellomyir” to development board, and execute :
    # ./hellomyir -qws

Copy the executable file to development board, and execute, you will see Qt window on the LCD screen "Make Your idea Real!"