Qt6 build 32bit on 64bit
-
Hello,
to my understanding configuring a kit like followed should make it able to build 32-bit application from Qt6 64-bit.
Telling the kit to use the amd64_x86 compiler means to use a 64-bit compiler toolset to produce binaries for your program targeting a 32-bit platform afaik.
I get following error:
-
I found the solution thanks to @jsulm:
https://doc.qt.io/qt-6/windows-building.html#step-3-set-the-environment-variables
%SystemRoot%\system32\cmd.exe /E:ON /V:ON /k C:\Qt\qt6vars.cmd
run this command in your cmd to set up the environment and KEEP the cmd OPEN. After that everything worked. -
If you want to built a 32bit executable all your dependent libraries are also need to be 32bit. This means you need a 32bit Qt libraries. Since there are no pre-built ones you have to compile it by your own.
But why someone would need a 32bit executable nowadays?
-
@Christian-Ehrlicher
I just configured the kit as shown and as you said, the linker could'nt find the corresponding 32-bit symbols.I tried building Qt6 32-bit from source. But following error made me give up tbh.
FYI: During covid times it was impossible to get a 64-bit industrial pc so we had to settle for 32-bit for our testing environment. We deploy 64-bit for our customers.
-
@Redman said in Qt6 build 32bit on 64bit:
the change I made is applied
What change do you mean?
Take a look at https://doc.qt.io/qt-6/windows-building.html -
I found the solution thanks to @jsulm:
https://doc.qt.io/qt-6/windows-building.html#step-3-set-the-environment-variables
%SystemRoot%\system32\cmd.exe /E:ON /V:ON /k C:\Qt\qt6vars.cmd
run this command in your cmd to set up the environment and KEEP the cmd OPEN. After that everything worked. -
-
@Redman said in Qt6 build 32bit on 64bit:
up the environment and KEEP the cmd OPEN.
Why should something you set up in one cmd instance be active in another one??
-
@Christian-Ehrlicher To me it seemed like a global variable that was set. Hence my assumption I could close the cmd.
-
@Redman
These.bat
or.cmd
files set environment variables. Their setting only lasts for the duration of thecmd
/Command Prompt where the script file is run (and anything spawned from there, e.g. compilations), they do not persist to your machine's environment as a whole. -
-
J JonB referenced this topic on