[solved] Building Qt 5.5 for Android on a Ubuntu 64-bit workstation

  • Hi,
    I'm trying to build Qt 5.5 from source and get the following problem on Ubuntu workstations.
    Note: I tried the same thing with the same source tree on my MacOSX, and it builds fine. The problem seems that
    the builder is using the incorrect compiler (using g++ instead of the correct arm-linux-androidabi-g++). On the Mac, the correct compiler is being used.

    distcc g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
    -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums
    -DANDROID -Wa,--noexecstack -fno-builtin-memmove -std=c++11 -g -g
    -marm -O0 -fno-omit-frame-pointer -fvisibility=hidden
    -fvisibility-inlines-hidden -Wall -Wno-psabi -W -D_REENTRANT -fPIC
    -DPCRE_HAVE_CONFIG_H -DQT_CORE_LIB -I. -I../../include
    -I../../include/QtCore -I../../include/QtCore/5.5.0
    -I../../include/QtCore/5.5.0/QtCore -Iglobal -I../3rdparty/pcre
    -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4
    -I../3rdparty/sha3 -I../3rdparty/forkfd -I.moc -isystem
    -isystem /home/vngthowhing/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include
    -isystem /home/vngthowhing/android-ndk-r10d/platforms/android-9/arch-arm/usr/include
    -I../../mkspecs/android-g++ tools/qstring_compat.cpp -o
    distcc[22518] (dcc_build_somewhere) Warning: failed to distribute,

    running locally instead
    g++: error: unrecognized command line option ‘-mfloat-abi=softfp’
    g++: error: unrecognized command line option ‘-mfpu=vfp’
    g++: error: unrecognized command line option ‘-marm’

  • Lifetime Qt Champion


    I see distcc here where does it come from ?

  • I took a look at qt5/qtbase/config.status which I believe is generated by configure:

    CXX='distcc g++' CC='distcc gcc' /home/vngthowhing/qt5/qtbase/configure -developer-build -opensource -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/vngthowhing/android-ndk-r10d -android-sdk /home/vngthowhing/android-sdk-linux -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -no-warnings-are-errors -confirm-license "$@"

    .... so I think configure is incorrectly setting CXX and CC incorrectly. However, I don't know where to fix this.


  • Okay, with help on the IRC chat #necessitas, I figured out that my CC and CXX were pre-defined (probably by my system adminstrator) as 'distcc gcc' and 'distcc g++' respectively. I had to unset these environment variables and rerun configure and make. Things work now (uses correct arm-based compiler).

    we may need to modify the configure script for Qt to unset CC and CXX if these environment variables are already defined.


  • Lifetime Qt Champion

    Nice ! For once it wasn't something to obscure :)

    Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

Log in to reply

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