Compiling Qt 5.3 source code for arm linux embedded

  • I know this has been discussed earlier and i have read most of the post on this topic. Maybe i still missed something. I'm trying to compile Qt source code for arm-linux so that i could cross compile software from my windows 7 machine for an arm-linux system. I've installed msvc 2013 on my windows 7 host and downloaded the target toolchain - CodeSourcery g++ lite. But I'm still struggling to compile the Qt source code. Maybe someone could point out my mistake?

    After getting the Qt source code, i'm able to run configure.exe and get the following output.
    c:\Dev\qt-everywhere-opensource-src-5.3.0\qtbase>configure.exe -debug -embedded
    -arch arm -neon -platform win32-msvc2013 -xplatform linux-arm-gnueabi-g++
    Which edition of Qt do you want to use ?
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.

    This is the Qt for Windows Open Source Edition.

    You are licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) version 2.1
    or the GNU General Public License (GPL) version 3.

    Type '3' to view the GNU General Public License version 3 (GPLv3).
    Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1).
    Type 'y' to accept this license offer.
    Type 'n' to decline this license offer.

    Do you accept the terms of the license?
    Creating qmake...

    NOTE: The -arch option is obsolete.

    Qt now detects the target and host architectures based on compiler
    output. Qt will be built using arm for the target architecture
    and i386 for the host architecture (note that these two
    will be the same unless you are cross-compiling).

    Generating Makefiles...

    Qt is now configured for building. Just run nmake.
    To reconfigure, run nmake confclean and configure.
    Next, i edit the existing qmake.conf in the \mkspecs\linux-arm-gnueabi-g++\ folder to be the following:


    qmake configuration for building with arm-none-linux-gnueabi-g++


    CONFIG += no_import_libs no_generated_target_info

    modifications to g++.conf

    QMAKE_CC = arm-none-linux-gnueabi-gcc
    QMAKE_CXX = arm-none-linux-gnueabi-g++
    QMAKE_LINK = arm-none-linux-gnueabi-g++
    QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
    QMAKE_LIB = arm-none-linux-gnueabi-ar
    QMAKE_AR = arm-none-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
    QMAKE_STRIP = arm-none-linux-gnueabi-strip
    QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
    QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $"@" $<
    QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
    QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $"@" $<
    QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe
    QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe
    QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe
    QMAKE_COPY = copy /y
    QMAKE_COPY_DIR = xcopy /s /q /y /i
    QMAKE_MOVE = move
    QMAKE_DEL_FILE = del
    QMAKE_MKDIR = mkdir
    QMAKE_DEL_DIR = rmdir
    QMAKE_CHK_DIR_EXISTS = if not exist
    QMAKE_IDL = midl
    QMAKE_ZIP = zip -r -9
    CODESOURCERY_ARM_CFLAGS = -march=armv7-a -mtune=cortex-a8 -mthumb -mfpu=neon -mfloat-abi=softfp -Wa,-mimplicit-it=thumb
    TARGET_SYSROOT = /CodeSourcery-sysroot
    TARGET_QTDIR = /QtEmbedded-5.3.1-arm
    #modifications to gcc-base.conf
    QMAKE_LIBS += -lrt -lpthread -ldl
    !isEmpty(TARGET_QTDIR) {
    !isEmpty(TARGET_SYSROOT) {
    QMAKE_LFLAGS += -Wl,--dynamic-linker=$${TARGET_SYSROOT}/lib/

    However, when i run either nmake or jom (yes, i did set the PATH to include jom.exe), i get an error - "test" is not recognized as an internal or external command....

    jom 1.0.14 - empower your cores

    'test' is not recognized as an internal or external command,
    operable program or batch file.
    A subdirectory or file -p already exists.
    Error occurred while processing: -p.
    A subdirectory or file src already exists.
    Error occurred while processing: src.
    A subdirectory or file cd already exists.
    Error occurred while processing: cd.
    A subdirectory or file src\ already exists.
    Error occurred while processing: src.
    jom: C:\Dev\qt-everywhere-opensource-src-5.3.0\qtbase\Makefile [sub-src-make_fir
    st] Error 1

    Any thoughts or suggestions?

  • Hi,

    Are you working with a specific ARM device, or trying to build Qt in a generic fashion?

    I've been working with embedded community boards for a while now and each board, each SoC has some kind of singularity, which usually results at least in specific mkspecs files for that device.

    Some examples include:

    • Raspberry Pi
    • Cubieboard
    • Beagleboard

    For example, for Cubieboard (A20 SoC), which is an ARM Cortex A8 dual core with a Mali 400MP2 GPU, I've successfully cross-compiled Qt5 using specific cubieboard mkspec files and the following configure line (generating cross-compiled QT5 libraries to work on framebuffer):

    -opengl es2
    -device linux-cubieboard2-g++
    -device-option CROSS_COMPILE=/opt/sdcard.cubieboard.workbench/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf-
    -sysroot /opt/qt5.cubieboard2A20.workbench/cubie2-rootfs
    -make libs
    -prefix /usr/local/qt5cb2
    -nomake examples
    -nomake tests

  • Hi,

    Im trying to get this to work on the Nvidia Jetson TK1, which has an ARM Cortex A15 (

    Also, you are on a linux host and compiling with linaro cross-compiler, right?
    I'm on win 7, trying to get this to work with codesourcery.

  • Yes, I'm using linaro gcc on Linux, although for my embedded boards, codesourcery was also recommended - but I ended up reverting to linaro as codesourcery somehow was giving me issues - but nothing specific like you are having on your Windows environment...

  • Hello,

    qt_for_embedded, or anyone that knows ...

    did you manage to solve the problem when trying to compile qt for arm in windows? I am having the same problem and not sure how to proceed at this moment. What is this "test" command?

    This is what I get:
    @PS C:\Qt\qt-everywhere-opensource-src-5.3.1> jom

    jom 1.0.14 - empower your cores

    'test' is not recognized as an internal or external command,
    operable program or batch file.
    A subdirectory or file qtbase already exists.
    Error occurred while processing: qtbase.
    A subdirectory or file qtbase\ already exists.
    Error occurred while processing: qtbase.
    jom: C:\Qt\qt-everywhere-opensource-src-5.3.1\Makefile [module-qtbase-make_first] Error 1@

    I am using the "linaro toolchain for windows": (I'm using Win7) and I've configured Qt to compile with the following options.

    @.\configure -prefix C:\Qt\qt-everywhere-opensource-src-5.3.1\qtbase -release -opensource -confirm-license -embedded -neon -platform win32-g++ -xplatform linux-arm-gnueabihf-g++ -skip qtwebkit -skip qtwebkit-examples -skip qtserialport -skip qttools -skip qtx11extras -skip qtandroidextras -nomake tools -nomake examples -nomake tests -no-opengl -no-compile-examples -no-widgets -no-gui -no-opengl -no-angle@

    The configuration step works well. Any help is appreciated. Thanks!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.