It is a problem to compile Qt For Android with MinGW in the win environment



  • My computer is trying to compile Qt For Android on Mingw with the following commands, but there is a problem:

    Configure -prefix D:\Qt\5.9.2\android_full -opensource -confirm-license -optimize-size -optimized-tools -separate-debug-info -developer-build -shared -plugin-manifests -ltcg -android-sdk E:\android\android-sdk-windows -android-ndk E:\android\ android-ndk-r14b -nomake examples -nomake tests -qt-doubleconversion -qt-zlib -icu -qt-pcre -system-proxies -qt-freetype -qt-harfbuzz -opengl dynamic -angle -combined-angle-lib -eglfs -qt-xcb -gif -ico -qt-libpng -qt-libjpeg -sqlite -qt-assimp --disable-rpath -android-arch armeabi-v7a -android-toolchain-version -xplatform android-g++ -platform win32-g++ -silent 4.9

    The following error occurred in the execution of the command:

    • CD qtbase
      -top-level -prefix D:\Qt\5.9.2\android_full -opensource + D:\Qt\Src\qt-everywhere-opensource-src-5.9.3\qtbase\configure.bat -confirm-license -optimize-size -optimized-tools -separate-debug-info -developer-build -shared -plugin-manifests -ltcg -android-sdk E:\android\android-sdk-windows -android-ndk E:\android\android-ndk-r14b -nomake examples -nomake tests -qt-doubleconversion -qt-zlib -icu -qt-pcre -system-proxies -qt-freetype -qt-harfbuzz -opengl dynamic -angle -combined-angle-lib -eglfs -qt-xcb -gif -ico -qt-libpng -qt-libjpeg -sqlite -qt-assimp --disable-rpath -android-arch armeabi-v7a -android-toolchain-version -xplatform android-g++ -platform win32-g++ -silent 4.9
      Bootstrapping qmake...
      G++ -c -o qmakebuiltins.o -DUNICODE -std=c++11 -ffunction-sections -g -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/library -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/ qmake/generators -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/generators/unix -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/generators/win32 -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/generators/mac -ID:/Qt/ Src/qt-everywhere-opensource-src-5.9.3/qtbase/include -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/include/QtCore -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/include/QtCore/5.9.3 -ID:/Qt/Src/qt-everywhere-opensource-src-5.9. 3/qtbase/include/QtCore/5.9.3/QtCore -I../src/corelib/global -ID:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/mkspecs/win32-g++ -DQT_VERSION_STR=\ "5.9.3" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=9 -DQT_VERSION_PATCH=3 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH D:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/library/qmakebuiltins.cpp
      D:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/library/qmakebuiltins.cpp: In member function'QByteArray QMakeEvaluator:: getCommandOutput (const QString&, int*) const':
      D:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/library/qmakebuiltins.cpp:500:104: error:'_popen'was not declared in this scope
      ("& &") + QLatin1String + args) (.ToLocal8Bit) (.ConstData), QT_POPEN_READ)) {
      ^
      D:/Qt/Src/qt-everywhere-opensource-src-5.9.3/qtbase/qmake/library/qmakebuiltins.cpp:508:32: error:'_pclose'was not declared in this scope
      Int EC = QT_PCLOSE (proc);
      ^
      Makefile:217: recipe for target'qmakebuiltins.o'failed
      Mingw32-make: * * * * [qmakebuiltins.o] Error 1

    How can I solve it?


  • Moderators

    @jack9603301 You need to use Android NDK if you want to build for Android.
    Why do you want to build Qt for Android by yourself? Qt for Android is officially available.



  • @jsulm said in It is a problem to compile Qt For Android with MinGW in the win environment:

    You need to use Android NDK if you want to build for Android.
    Why do you want to build Qt for Android by yourself? Qt for Android is officially available.

    Because I have a self compiled version of MSVC, I don't want to destroy the overall unification of the catalog partition.

    The MinGW environment, which is currently using the mingw_w64 version of the official link based on official links, has passed but there is a link error in the link MOC:
    C:\Users\jack\AppData\Local\Temp\ccC7YcUg.ltrans0.ltrans.o:<artificial>: (.Text+0x8d): undefined reference to `qstrcmp (QByteArray const&, QByteArray const&).


  • Moderators

    @jack9603301 said in It is a problem to compile Qt For Android with MinGW in the win environment:

    Because I have a self compiled version of MSVC, I don't want to destroy the overall unification of the catalog partition.

    Don't know what you mean here.

    Android is usually running on ARM CPUs. You can't use a compiler which generates x86 binaries and you need Android SDK to be able to compile and link Qt/apps for Android.



  • @jsulm said in It is a problem to compile Qt For Android with MinGW in the win environment:

    @jack9603301 said in It is a problem to compile Qt For Android with MinGW in the win environment:

    Because I have a self compiled version of MSVC, I don't want to destroy the overall unification of the catalog partition.

    Don't know what you mean here.

    Android is usually running on ARM CPUs. You can't use a compiler which generates x86 binaries and you need Android SDK to be able to compile and link Qt/apps for Android.

    So how should I set up cross - compilation?


  • Moderators


Log in to reply
 

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