Qt World Summit: Submit your Presentation

Qt Creator environment setup - cross-compiling to ARM

  • hello,
    I recently built yocto poky 2.0.1 which includes Qt.5.5 toolchain. i already have Qt 5.4 toolchain installed and Qt Creator setup with it for my imx6 board and everything runs fine with Qt5.4.

    Unfortunately when i switch to Qt5.5 my compilation fails on the same application (Clocks Demo) which passes for 5.4 with "make: Command not found". Qt Creator's log is very minimal and not much help. Here is what i get in Compile Output window:

    23:17:54: Running steps for project clocks...
    23:17:54: Configuration unchanged, skipping qmake step.
    23:17:54: Starting: "/usr/bin/make" 
    c -pipe  -g -DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../clocks -I. -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtQml -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -o main.o ../clocks/main.cpp
    make: c: Command not found
    make: [main.o] Error 127 (ignored)
    /opt/poky/2.0.1/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/rcc -name clocks ../clocks/clocks.qrc -o qrc_clocks.cpp
    c -pipe  -g -DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../clocks -I. -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtQml -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork -isystem /opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/poky/2.0.1/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -o qrc_clocks.o qrc_clocks.cpp
    o clocks main.o qrc_clocks.o   -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lEGL -lGAL -lpthread 
    make: c: Command not found
    make: [qrc_clocks.o] Error 127 (ignored)
    make: o: Command not found
    make: [clocks] Error 127 (ignored)
    23:17:54: The process "/usr/bin/make" exited normally.
    23:17:55: Elapsed time: 00:00.

    here are my questions:

    1. is there a way to make this output more detailed? i tried VERBOSE=1 in "Make arguments" but no difference.
    2. is this related to environment variable setup? yocto generates script in [sdk path]/sysroots/x86_64-pokysdk-linux/environment-setup.d/qt5.sh which has seval path exports but script fails.
    3. Does Qt Creator use some startup script which sets paths to libraries?

  • Lifetime Qt Champion

    Actually the output already says what is wrong: command "c" cannot be found (what is it? Your C++ compiler?).
    If you switch to Qt5.5 you should delete the build directory, run qmake and then rebuild.

  • Thank you for the quick response!

    I first used gcc 4.8.4, then upgraded to gcc 4.9.3 with no difference. (This probably was not well thought through decision)
    I did not delete the build dir for this app, but when a new kit was created for the Qt5.5 then the build gets placed automatically in the new directory. But I will try your suggestion and delete the build dir and try again.

    Please excuse my simplistic questions, but I'm a newbie in this area. Does the error mean the problem is with compiler and not cross-compiler? If yes, then why does it compile correctly for ubuntu desktop and only shows errors for the arm target?

  • Lifetime Qt Champion

    Well, for Ubuntu g++ is used to compile.
    When you cross compile "c" is used as compiler and I have no idea what it is and where it is located. You should check the Kit you use to cross compile your project.

    There is even more:

    make: o: Command not found

    What is "o"? I guess the linker? Where do these strange names ("c" and "o") come from?

  • I found the solution here: Setup QT creator for developing QT apps on wandboard

    The problem was solved by adding environment variables to the qtcreator.sh script and launching the QtCreator with this script instead.

  • Hi,

    I'm facing the same problem actually, I want to cross compile on udoo board.

    I don't really understand where in the Qt creator you add the lines.
    If you sources the environment of toolchain it's not enough?

    Thanks in advance for your help

Log in to reply