Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Compile Qt Sources for Linux 32-bit



  • Host os = Xubuntu 18.04.2 64-bit
    Qt sources = 5.12.1
    Qt creator = 4.8.2

    $ ./configure -platform linux-g++-32
    
    Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
    
    WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.
    
    Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
    On Linux systems you may be able to install libclang from a package. On macOS you could use Homebrew's llvm package.
    On Windows you need to set LLVM_INSTALL_DIR to the installation path.
    
    ERROR: The OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
    QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
    
    Check config.log for details.
    
    Checking for pkg-config ... no
    Checking for xkbcommon >= 0.5.0... no
    xkbcommon .............................. no
    
    WARNING: Cross compiling without sysroot. Disabling pkg-config
    
    ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && features.xkbcommon && libs.xcb' failed.
    

    I want to build applications for linux 32-bit, How?



  • For linux x64 64-bit on linux x64 64-bit :

    sudo apt install make g++ libgl1-mesa-dev pkg-config libxkbcommon-dev libxkbcommon-dev
    
    ./configure -qt-xcb
    

    For linux x86 32-bit on linux x64 64-bit :

    sudo apt install make g++-multilib libgl1-mesa-dev:i386 libglu1-mesa-dev:i386 pkg-config:i386 libxkbcommon-dev:i386 libxkbcommon-dev:i386
    
    ./configure -platform linux-g++-32 -qt-xcb
    

    Note: For Windows Vista 7 8 8.1 10 use last Qt release, but for Windows XP use Qt 5.6.3

    For Windows x86 32-bit on Linux 64-bit :

    sudo apt install make g++ mingw-w64
    
    ./configure -opengl desktop -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32-
    

    For Windows x64 64-bit on Linux x64 64-bit :

    sudo apt install make g++ mingw-w64
    
    ./configure -opengl desktop -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/x86_64-w64-mingw32-
    

    Note: For Android you need download NDK and SDK

    For Android ARM v7 :

    sudo apt install make g++ openjdk-11-jdk
    
    ./configure -xplatform android-clang -android-ndk "./android-ndk-r19c" -android-sdk "./sdk" -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -android-ndk-platform android-28 -skip qttranslations -skip qtserialport -android-arch armeabi-v7a
    

    For Android x86 :

    sudo apt install make g++ openjdk-11-jdk
    
    ./configure -xplatform android-clang -android-ndk "./android-ndk-r19c" -android-sdk "./sdk" -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -android-ndk-platform android-28 -skip qttranslations -skip qtserialport -android-arch x86
    

    More parameters can be added :

    ./configure -opensource -confirm-license -nomake examples -nomake tests -release -prefix "./install-path"
    

    More packages can be installed :

    sudo apt install gperf bison flex
    

    Bug in build Qt 5.12 for Windows x86 :
    Fix it by edit "./qtbase/src/corelib/global/qrandom.cpp" from "#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)" to "#if 0"

    Bug in Android SDK :
    Fix it by edit "./sdk/tools/bin/sdkmanager" from " DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME"' " to " DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee' "



  • This post is deleted!

  • Lifetime Qt Champion

    Hi
    You also need all the required dependencies.
    https://doc.qt.io/qt-5/build-sources.html



  • All requirements have been successfully installed, but the error still exists.
    If use "-no-opengl" everything successfully without error
    And also i can compile 32-bit "Widget" applications successfully
    But without "-opengl" I could not run 32-bit "Widget" applications, becouse the "libqxcb.so" file not found !!!
    How to fix it ?




  • Lifetime Qt Champion

    @EnormousSoft Add -v parameter to configure and take a look at the output - it should tell more about the problem (missing headers/libs probably).



  • For linux x64 64-bit on linux x64 64-bit :

    sudo apt install make g++ libgl1-mesa-dev pkg-config libxkbcommon-dev libxkbcommon-dev
    
    ./configure -qt-xcb
    

    For linux x86 32-bit on linux x64 64-bit :

    sudo apt install make g++-multilib libgl1-mesa-dev:i386 libglu1-mesa-dev:i386 pkg-config:i386 libxkbcommon-dev:i386 libxkbcommon-dev:i386
    
    ./configure -platform linux-g++-32 -qt-xcb
    

    Note: For Windows Vista 7 8 8.1 10 use last Qt release, but for Windows XP use Qt 5.6.3

    For Windows x86 32-bit on Linux 64-bit :

    sudo apt install make g++ mingw-w64
    
    ./configure -opengl desktop -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32-
    

    For Windows x64 64-bit on Linux x64 64-bit :

    sudo apt install make g++ mingw-w64
    
    ./configure -opengl desktop -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/x86_64-w64-mingw32-
    

    Note: For Android you need download NDK and SDK

    For Android ARM v7 :

    sudo apt install make g++ openjdk-11-jdk
    
    ./configure -xplatform android-clang -android-ndk "./android-ndk-r19c" -android-sdk "./sdk" -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -android-ndk-platform android-28 -skip qttranslations -skip qtserialport -android-arch armeabi-v7a
    

    For Android x86 :

    sudo apt install make g++ openjdk-11-jdk
    
    ./configure -xplatform android-clang -android-ndk "./android-ndk-r19c" -android-sdk "./sdk" -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -android-ndk-platform android-28 -skip qttranslations -skip qtserialport -android-arch x86
    

    More parameters can be added :

    ./configure -opensource -confirm-license -nomake examples -nomake tests -release -prefix "./install-path"
    

    More packages can be installed :

    sudo apt install gperf bison flex
    

    Bug in build Qt 5.12 for Windows x86 :
    Fix it by edit "./qtbase/src/corelib/global/qrandom.cpp" from "#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)" to "#if 0"

    Bug in Android SDK :
    Fix it by edit "./sdk/tools/bin/sdkmanager" from " DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME"' " to " DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee' "


Log in to reply