Compile Qt 5 android failed



  • Hello,

    Firstable, sorry for my english.

    I try to compil Qt5 from git.
    I'm able to compile with developer-build but not with android-g++

    I make some search on the net and I installed these packages :
    sudo apt-get install ant libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 libsdl1.2debian:i386 git Perl Python build-essential libgl1-mesa-dev xcb libxcb blender libqt5designer5 OpenSSL libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libcap-dev libbz2-dev libgcrypt11-dev libpci-dev libnss3-dev build-essential libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libdrm-dev libfontconfig1-dev libxtst-dev libasound2-dev gperf libcups2-dev libpulse-dev libudev-dev libssl-dev flex bison ruby libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

    I run the ./configure command : sudo ./configure -developer-build -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/wickpasc/ANDROID/android-ndk-r10e -android-sdk /home/wickpasc/ANDROID/android-sdk-linux -skip qttools -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -no-warnings-are-errors
    Result :
    Do you accept the terms of the license? yes

    <srcbase> = /home/wickpasc/build/qt5/qtbase
    <outbase> = /home/wickpasc/build/qt5/qtbase
    QtCore: created fwd-include header(s) for <srcbase>/src/corelib/io/ { qdebug_p.h (1) }
    QtCore: created fwd-include header(s) for <srcbase>/src/corelib/tools/ { qstringalgorithms_p.h (1) }
    Creating qmake...
    ........................................................................................Done.
    Running configuration tests...
    Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
    Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.

    Configure summary

    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: android-g++ (arm, CPU features: none detected)
    Platform notes:

            - Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
    

    Build options:
    Configuration .......... accessibility android-style-assets audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile debug egl eglfs evdev eventfd freetype full-config getaddrinfo harfbuzz headersclean inotify ipv6ifname large-config medium-config minimal-config mremap no-pkg-config opengl opengles2 pcre png precompile_header private_tests qpa qpa reduce_exports rpath shared small-config system-zlib use_gold_linker
    Build parts ............ libs
    Mode ................... debug
    Using sanitizer(s)...... none
    Using C++11 ............ yes
    Using gold linker....... yes
    Using new DTAGS ........ no
    Using PCH .............. yes
    Target compiler supports:
    Neon ................. no

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

    Support enabled for:
    Accessibility .......... yes
    ALSA ................... no
    CUPS ................... no
    Evdev .................. yes
    FontConfig ............. no
    FreeType ............... yes (bundled copy)
    Glib ................... no
    GStreamer .............. no
    GTK theme .............. no
    HarfBuzz ............... yes (bundled copy)
    Iconv .................. no
    ICU .................... no
    Image formats:
    GIF .................. yes (plugin, using bundled copy)
    JPEG ................. yes (plugin, using bundled copy)
    PNG .................. yes (in QtGui, using bundled copy)
    journald ............... no
    libinput................ no
    mtdev .................. no
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... no
    IPv6 ifname .......... yes
    libproxy.............. no
    OpenSSL .............. no
    NIS .................... no
    OpenGL / OpenVG:
    EGL .................. yes
    OpenGL ............... yes (OpenGL ES 2.0+)
    OpenVG ............... no
    PCRE ................... yes (bundled copy)
    pkg-config ............. no
    PulseAudio ............. no
    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    EGLFS i.MX6....... . no
    EGLFS KMS .......... no
    EGLFS Mali ......... no
    EGLFS Raspberry Pi . no
    EGLFS X11 .......... no
    LinuxFB .............. no
    XCB .................. no
    Session management ..... yes
    SQL drivers:
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... yes (plugin, using bundled copy)
    TDS .................. no
    tslib .................. no
    udev ................... no
    xkbcommon-x11........... no
    xkbcommon-evdev......... no
    zlib ................... yes (system library)

    I run make command like this : sudo make -j4 -s
    Result :
    wickpasc@wickpasc-X75VC:~/build/qt5$ sudo make -j4 -s
    Project MESSAGE: perl -w /home/wickpasc/build/qt5/qtbase/bin/syncqt.pl -minimal -module QtCore -module QtDBus -module QtXml -version 5.5.1 -outdir /home/wickpasc/build/qt5/qtbase /home/wickpasc/build/qt5/qtbase
    <srcbase> = /home/wickpasc/build/qt5/qtbase
    <outbase> = /home/wickpasc/build/qt5/qtbase
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Project MESSAGE: perl -w /home/wickpasc/build/qt5/qtbase/bin/syncqt.pl -check-includes -module QtCore -version 5.5.1 -outdir /home/wickpasc/build/qt5/qtbase /home/wickpasc/build/qt5/qtbase
    <srcbase> = /home/wickpasc/build/qt5/qtbase
    <outbase> = /home/wickpasc/build/qt5/qtbase
    QtCore: updated version header
    QtCore: updated headers.pri file
    io/qstorageinfo_unix.cpp: In constructor 'QStorageIterator::QStorageIterator()':
    io/qstorageinfo_unix.cpp:245:33: warning: 'QString::QString(const char*)' is deprecated (declared at ../../include/QtCore/../../src/corelib/tools/qstring.h:649) [-Wdeprecated-declarations]
    file.setFileName(pathMounted);
    ^
    /home/wickpasc/ANDROID/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.gold: error: .obj/qrc_mimetypes.o: incompatible target
    mimetypes/qmimeprovider.cpp:53: error: undefined reference to 'qInitResources_mimetypes()'
    collect2: error: ld returned 1 exit status
    Makefile:1301: recipe for target '../../lib/libQt5Core.so' failed
    make[3]: *** [../../lib/libQt5Core.so] Error 1
    Makefile:167: recipe for target 'sub-corelib-make_first' failed
    make[2]: *** [sub-corelib-make_first] Error 2
    Makefile:45: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    Makefile:68: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2
    wickpasc@wickpasc-X75VC:~/build/qt5$

    Thanks for Help
    Pascal WICK



  • I found.

    sudo ./configure -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/wickpasc2/ANDROID/android-ndk-r10e -android-sdk /home/wickpasc2/ANDROID/android-sdk-linux -android-toolchain-version 4.8 -android-style-assets** -android-ndk-host linux-x86_64 -android-arch armeabi-v7a **-skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -skip qtlocation -skip qtwebengine -skip qt3d -no-warnings-are-errors -no-pkg-config
    
    sudo make install -j4 -s
    
    sudo make install

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Having to use sudo looks fishy, unless you are using some "protected" folders to do some things.



  • @SGaist

    I juste retry without sudo and I got this

    wickpasc2@wickpasc2-X75VC:~$ cd build/qt-everywhere-opensource-src-5.5.0/
    wickpasc2@wickpasc2-X75VC:~/build/qt-everywhere-opensource-src-5.5.0$ ./configure -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/wickpasc2/ANDROID/android-ndk-r10e -android-sdk /home/wickpasc2/ANDROID/android-sdk-linux -android-toolchain-version 4.8 -android-style-assets -android-ndk-host linux-x86_64 -android-arch armeabi-v7a -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -skip qtlocation -skip qtwebengine -skip qt3d -no-warnings-are-errors -no-pkg-config

    • cd qtbase
    • /home/wickpasc2/build/qt-everywhere-opensource-src-5.5.0/qtbase/configure -top-level -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/wickpasc2/ANDROID/android-ndk-r10e -android-sdk /home/wickpasc2/ANDROID/android-sdk-linux -android-toolchain-version 4.8 -android-style-assets -android-ndk-host linux-x86_64 -android-arch armeabi-v7a -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -skip qtlocation -skip qtwebengine -skip qt3d -no-warnings-are-errors -no-pkg-config
      /home/wickpasc2/build/qt-everywhere-opensource-src-5.5.0/qtbase/configure: 108: /home/wickpasc2/build/qt-everywhere-opensource-src-5.5.0/qtbase/configure: cannot create .qmake.vars: Permission denied
      wickpasc2@wickpasc2-X75VC:~/build/qt-everywhere-opensource-src-5.5.0$

  • Lifetime Qt Champion

    It won't work, you created everything as root, so normal users can't access it. You have to nuke the build folder and start from clean if you wan't to do it as your current user (and you should, never ever develop as root) you should only sudo if you have to install something in a system folder.


Log in to reply
 

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