Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. cross compiling Qt for a 32-bit architecture.
Forum Updated to NodeBB v4.3 + New Features

cross compiling Qt for a 32-bit architecture.

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
1 Posts 1 Posters 188 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CyberCrisis
    wrote on 3 Oct 2024, 18:45 last edited by CyberCrisis 10 Mar 2024, 18:50
    #1

    Re: Building Static Qt: how to specify 32 bit?

    Hello!

    I am currently going through a situation where a client asked for a 32-bit windows version of my application.
    I am working from a 64-bit windows machine. I did some research and found that I need to cross-compile to a 32-bit platform. So, I used the example given here: qmake.conf

    My Qt 5.12.6 installation came with MinGW730-32 and MinGW730-64.
    I should be able to use the MinGW730-32 toolchain for building a 32-bit release static qt source.
    I added 'C:\Qt\qt5.12.6\tools\MinGW730-32\bin' to the PATH environment variable.
    I also have the 64-bit toolchain in the PATH.

    I started with the configure command from here: Building QT with MinGW and modified it through trial and error because
    I don't have all the modules listed originally. I removed some of them from the original command when the script couldn't find them.
    This is what my configure script looks like now with the added cross compilation and make tool options:

    configure -static -release -xplatform win32-g++ -commercial -confirm-license -prefix C:\Qt\qt5.12.6\5.12.5\qt-5.12.6_static_32bit -make-tool C:\Qt\qt5.12.6\tools\mingw730_32\bin\mingw32-make.exe -qt-zlib -qt-libpng -qt-webp -qt-libjpeg -qt-freetype  -no-opengl -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivty -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscript -skip qtsensors -skip qtspeech -skip qtsvg -skip qtwayland -skip qtwebglplugin -skip qtwebview -skip webengine -make libs -nomake tools -nomake examples -nomake tests"
    

    I tried running C:\Qt\qt5.12.6\tools\MinGW730-32\bin\mingw32-make.exe, but it errors out because it cannot find an executable called i686-w64-mingw32-ar. I looked into it and I saw that the executable for i686-w64-mingw32-ar does in fact not exist at: C:\Qt\qt5.12.6\tools\MinGW730-32\bin

    I am wondering if there is an issue with how my Makefile.Release files got created.
    My hunch is that there is an issue with my src/qtbase/qmake/qmake.exe
    I think it took the cross-compiler value I gave the configure script (i686-w64-mingw32-) and appended ar at the end. My guess is that it should have used the mkspecs (win32-g++) to properly to append gcc before appending ar.
    I think this because i686-w64-mingw32-gcc-ar.exe does exist in the bin directory.

    I found 68 Makefile.Release files that contain

    LIB=  i686-w64-mingw32-ar -rc
    

    I don't know what the qmake.stash file is used for, but I also found that it has values pointing to my 64-bit toolchain.
    Could it be that my qmake.exe is creating my files incorrectly because it was maybe built with the 64-bit toolchain?
    How do I know for sure?

    I am hoping someone can help me figure this out.

    Should I try removing the 64-bit toolchain from the PATH, do a clean and remake and hope that my qmake.exe create my makefiles.release files properly?
    or

    is the problem with the configure script?

    Any suggestion, advice or help is appreciated!

    1 Reply Last reply
    0

    1/1

    3 Oct 2024, 18:45

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved