using Qt 5.5 to build android arm64_v8a lib and get fail on linux and macosx



  • hi all:
    i trying to build arm64 on macosx and linux (centos) been two weeks,
    but all i got was same error, i am using 5.5.1 version on github
    i am using this to help me build: http://wiki.qt.io/Qt5ForAndroidBuilding
    could somebody give me some hint to break this problem?

    below is my configure

    ./configure \
    -xplatform android-g++ \
    -nomake tests \
    -nomake examples \
    -android-ndk /home/zam/ndk \
    -android-sdk /home/zam/sdk \
    -android-ndk-host linux-x86_64 \
    -android-ndk-platform android-21 \
    -android-toolchain-version 4.9 \
    -android-arch arm64-v8a \
    -android-ndk-platform android-21 \
    -skip qttranslations \
    -skip qtwebkit \
    -skip qtserialport \
    -skip qtwebkit-examples \
    -confirm-license -opensource -release \
    -prefix /home/zam/Qt5.5_arm64 \
    -no-warnings-are-errors -v         
    

    i wiil get error when i use -v

    /home/zam/qt5/qtbase/configure -top-level -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/zam/ndk -android-sdk /home/zam/sdk -android-ndk-host linux-x86_64 -android-ndk-platform android-21 -android-toolchain-version 4.9 -android-arch arm64-v8a -android-ndk-platform android-21 -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -confirm-license -opensource -release -prefix /home/zam/Qt5.5_arm64 -no-warnings-are-errors -v
    
    This is the Qt Open Source Edition.
    
    You are licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) versions 3.
    
    You have already accepted the terms of the Open Source license.
    
    Precompiled-headers support enabled.
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ --sysroot=/home/zam/ndk/platforms/android-21/arch-arm64/ -c -fvisibility=hidden fvisibility.c
    Symbol visibility control enabled.
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9/../../../../aarch64-linux-android/bin/ld.gold: error: cannot open crtbegin_dynamic.o: No such file or directory
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9/../../../../aarch64-    linux-android/bin/ld.gold: error: cannot open crtend_android.o: No such file or directory
    collect2: error: ld returned 1 exit status
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ --sysroot=/home/zam/ndk/platforms/android-21/arch-arm64/ -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
    bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
     #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
      ^
    Symbolic function binding disabled.
    
    ...
    Project ERROR: mtdev development package not found
    mtdev disabled.
    libjpeg auto-detection... ()
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ -c -ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -O2 -O2 -Wall -Wno-psabi -W -fPIC  -I. -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem /home/zam/ndk/platforms/android-21/arch-arm64/usr/include -I../../../mkspecs/android-g++ -o libjpeg.o libjpeg.cpp
    libjpeg.cpp:37:21: fatal error: jpeglib.h: No such file or directory
     #include <jpeglib.h>
                     ^
    compilation terminated.
    libpng auto-detection... ()
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ -c -ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -O2 -O2 -Wall -Wno-psabi -W -fPIC  -I. -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem /home/zam/ndk/platforms/android-21/arch-arm64/usr/include -I../../../mkspecs/android-g++ -o libpng.o libpng.cpp
    libpng.cpp:34:17: fatal error: png.h: No such file or directory
     #include <png.h>
                 ^
    compilation terminated.
    gmake: *** [libpng.o] Error 1
    libpng disabled.
    DB2 auto-detection... ()
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ -c -ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -O2 -O2 -Wall -Wno-psabi -W -fPIC  -I. -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem /home/zam/ndk/platforms/android-21/arch-arm64/usr/include -I../../../mkspecs/android-g++ -o db2.o db2.cpp
    db2.cpp:34:20: fatal error: sqlcli.h: No such file or directory
     #include <sqlcli.h>
                    ^
    compilation terminated.
    gmake: *** [db2.o] Error 1
    

    if i run 'make' anyway, i will get this error, all the error around cmath can't find any declared

    make[3]: Entering directory `/home/zam/qt5/qtbase/src/3rdparty/harfbuzz-ng'
    /home/zam/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ -c -ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -O2 -O2 -fPIC -Wno-psabi -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DHAVE_OT -DHAVE_QT5_ATOMICS -DHB_NO_UNICODE_FUNCS -DHB_DISABLE_DEPRECATED -DHAVE_ATEXIT -DHAVE_PTHREAD -DHAVE_SCHED_H -DHAVE_SCHED_YIELD -DQT_NO_EXCEPTIONS -I. -Iinclude -I../../../include -I../../../include/QtCore -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem /home/zam/ndk/platforms/android-21/arch-arm64/usr/include -I../../../mkspecs/android-g++ -o .obj/hb-blob.o src/hb-blob.cc
    In file included from /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/random:38:0,
                 from /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_algo.h:66,
                 from /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/algorithm:62,
                 from ../../../include/QtCore/../../src/corelib/global/qglobal.h:85,
                 from ../../../include/QtCore/qglobal.h:1,
                 from ../../../include/QtCore/../../src/corelib/thread/qatomic.h:34,
                 from ../../../include/QtCore/qatomic.h:1,
                 from src/hb-atomic-private.hh:45,
                 from src/hb-object-private.hh:37,
                 from src/hb-blob.cc:34:
    /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/cmath: In function 'constexpr int std::fpclassify(float)':
    /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/cmath:562:33: error: 'FP_NAN' was not declared in this scope
       { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
                                 ^
    /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/cmath:562:41: error: 'FP_INFINITE' was not declared in this scope
       { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
                                         ^
    /home/zam/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/cmath:562:54: error: 'FP_NORMAL' was not declared in this scope
       { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,


  • you can fix this error by edit this file
    qt551_src/qtbase/src/3rdparty/harfbuzz-ng/Makefile

    removing '-std=c++11' fix error....



  • I commented out line 85 of qtbase/src/corelib/global/qglobal.h removing #include <algorithm>.

    --- a/src/corelib/global/qglobal.h
    +++ b/src/corelib/global/qglobal.h
    @@ -82,7 +82,7 @@

    #ifdef __cplusplus

    -#include <algorithm>
    +//#include <algorithm>

    Seems to be an issue in ndk: https://code.google.com/p/android/issues/detail?id=194631



  • Just add -no-c++11 option to the ./configure file.
    Ok, i made what @granolamatt suggested and it worked.


Log in to reply
 

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