QT5.1 for android compilation error.



  • Hi all,

    I'm trying to build QT5 for Android according manual - http://qt-project.org/wiki/Qt5ForAndroidBuilding
    Stage 6 -
    make
    returns error (after a few mins or work) :
    cc1plus: error: unrecognized command line option ‘-mfpu=neon’
    @
    g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_USE_BUNDLED_LIBPNG -DQT_NO_EXCEPTIONS -DQT_CORE_LIB -mfpu=neon -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtGui -I../../include/QtGui/5.1.0 -I../../include/QtGui/5.1.0/QtGui -Iimage -I../3rdparty/libpng -I../../include/QtCore -I../../include/QtCore/5.1.0 -I../../include/QtCore/5.1.0/QtCore -I.moc/debug-shared image/qimage_neon.cpp -o .obj/debug-shared/qimage_neon.o
    cc1plus: error: unrecognized command line option ‘-mfpu=neon’
    @

    Host machine is Gentoo Linux x86

    Will appreciate any advice.


  • Lifetime Qt Champion

    Hi,

    It seems you are using a x86 compiler. -mfpu neon concerns ARM processor. If you want to build for Android on ARM you'll need a cross-compiler



  • I use the manual - http://qt-project.org/wiki/Qt5ForAndroidBuilding

    Stage 5 - is configure
    @./configure -developer-build -xplatform android-g++ -nomake tests -nomake examples -android-ndk <path/to/ndk> -android-sdk <path/to/sdk> -skip qttools -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples-and-demos
    @

    I provide correct paths for Android SDK & NDK.
    I suppose it is compiled with right gcc version. Isn't ?


  • Lifetime Qt Champion

    From what I can see, it uses the linux-g++ mkspec, since you're building for android it should be the android-g++ mkspec, so there is something wrong.

    Did you check that the configuration was successful ?



  • configuration looks ok, but g++ is running with linux-g++

    What's wrong ?

    @
    Configure summary

    Building on: linux-g++ (i386, CPU features:)
    Building for: android-g++ (arm, CPU features:)

    Build options:
    Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic concurrent cross_compile debug egl eglfs evdev eventfd freetype full-config getaddrinfo inotify ipv6ifname large-config medium-config minimal-config mremap neon no-pkg-config opengl opengles2 pcre png precompile_header private_tests qpa qpa reduce_exports reduce_relocations rpath shared small-config system-zlib v8 v8snapshot warnings_are_errors
    Build parts ............ libs
    Mode ................... debug
    Using C++11 ............ yes
    Using PCH .............. yes
    Target compiler supports:
    iWMMXt/Neon .......... no/yes

    Qt modules and options:
    Qt D-Bus ............... no
    Qt Concurrent .......... yes
    Qt GUI ................. yes
    Qt Widgets ............. yes
    JavaScriptCore JIT ..... no
    QML debugging .......... yes
    Use system proxies ..... no

    Support enabled for:
    Accessibility .......... yes
    ALSA ................... no
    CUPS ................... no
    FontConfig ............. no
    Iconv .................. no
    ICU .................... no
    Image formats:
    GIF .................. plugin
    JPEG ................. plugin (qt)
    PNG .................. yes (qt)
    Glib ................... no
    GStreamer .............. no
    GTK theme .............. no
    Large Files ............ no
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... no
    IPv6 ifname .......... yes
    OpenSSL .............. no
    NIS .................... no
    OpenGL ................. yes (OpenGL ES 2.x)
    OpenVG ................. no
    PCRE ................... yes (qt)
    pkg-config ............. no
    PulseAudio ............. no
    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. no
    XCB .................. no
    Session management ..... auto
    SQL drivers:
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... plugin (qt)
    TDS .................. no
    udev ................... no
    xkbcommon .............. no
    zlib ................... yes (system)

    Qt is now configured for building. Just run 'gmake'.
    Once everything is built, Qt is installed.
    You should not run 'gmake install'.

    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.

    @


  • Lifetime Qt Champion

    Check your android-g++ mkspec to be sure it's correct



  • Oh,
    I have files in qt5.../qtbase/mkspecs/android-g++/
    but to be honest I don't know how to check if it's correct.

    I tried to compile qt5.1-alfa and qt5 cloned from the git.

    Results are the same.


  • Lifetime Qt Champion

    From a quick lookup in the qmake.conf in this folder, I would say that it fails to determine ANDROID_TOOLCHAIN_PREFIX, could you do a verbose configure to see if there are tests that fails ?


Log in to reply
 

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