How to distinguish between minGW32 and minGW64
-
Hi all,
I need a switch in a .pro file to link to different (32 vs 64) bit external libraries.
Documentation gives examples like:
win32-g++:contains(QMAKE_HOST.arch, x86_64):{
message("Host is 64bit")
...
}When I switch between MSVC2017 32Bit and MSVC2017 64Bit, I get the correct output (e.g: "Host is 64Bit" when chosen MSVC2017 64Bit)
However, when I try the same using minGW32 and minGW64, I always get "Host is 32Bit".I tried to output both QMAKE_HOST.arch and QMAKE_TARGET.arch, I always get the result: "x86".
Today I even reinstalled Qt completely, but I cannot find away to distinguish between minGW32 and minGW64.I tried several Versions of Qt, at the moment I am on Qt 5.12.6.
Do I miss a major point, or is that a known / expected behavior?
Thanks in advance for any help!
BR, Robert
-
Hi, I just found the ?undocumented? variable 'QT_ARCH' which has the value 'i386' for 32Bit MinGW builds and 'x86_64' for 64Bit MinGW builds.
I am not sure if this is the correct way to check the architecture for including 3rd party 32 or 64 bit dlls, but for my purpose it is sufficient.
It would be nice if anyone could confirm that this is the right way.
Why is this variable undocumented in Qt documentation?
Thanks,
Robert -
Hi all,
I need a switch in a .pro file to link to different (32 vs 64) bit external libraries.
Documentation gives examples like:
win32-g++:contains(QMAKE_HOST.arch, x86_64):{
message("Host is 64bit")
...
}When I switch between MSVC2017 32Bit and MSVC2017 64Bit, I get the correct output (e.g: "Host is 64Bit" when chosen MSVC2017 64Bit)
However, when I try the same using minGW32 and minGW64, I always get "Host is 32Bit".I tried to output both QMAKE_HOST.arch and QMAKE_TARGET.arch, I always get the result: "x86".
Today I even reinstalled Qt completely, but I cannot find away to distinguish between minGW32 and minGW64.I tried several Versions of Qt, at the moment I am on Qt 5.12.6.
Do I miss a major point, or is that a known / expected behavior?
Thanks in advance for any help!
BR, Robert
@Robert-Veigl said in How to distinguish between minGW32 and minGW64:
QMAKE_HOST.arch
Try to use
QMAKE_TARGET.arch
instead. I cannot guarantee it will work for MinGW, though. I use this with MSVC.Regards
-
Hi all,
I need a switch in a .pro file to link to different (32 vs 64) bit external libraries.
Documentation gives examples like:
win32-g++:contains(QMAKE_HOST.arch, x86_64):{
message("Host is 64bit")
...
}When I switch between MSVC2017 32Bit and MSVC2017 64Bit, I get the correct output (e.g: "Host is 64Bit" when chosen MSVC2017 64Bit)
However, when I try the same using minGW32 and minGW64, I always get "Host is 32Bit".I tried to output both QMAKE_HOST.arch and QMAKE_TARGET.arch, I always get the result: "x86".
Today I even reinstalled Qt completely, but I cannot find away to distinguish between minGW32 and minGW64.I tried several Versions of Qt, at the moment I am on Qt 5.12.6.
Do I miss a major point, or is that a known / expected behavior?
Thanks in advance for any help!
BR, Robert
Thanks aha_1980, but as I already mentioned in my initial post:
@Robert-Veigl said in How to distinguish between minGW32 and minGW64:
When I switch between MSVC2017 32Bit and MSVC2017 64Bit, I get the correct output (e.g: "Host is 64Bit" when chosen MSVC2017 64Bit)
However, when I try the same using minGW32 and minGW64, I always get "Host is 32Bit".I tried to output both QMAKE_HOST.arch and QMAKE_TARGET.arch, I always get the result: "x86".
Today I even reinstalled Qt completely, but I cannot find away to distinguish between minGW32 and minGW64....QMAKE_TARGET.arch is what documentation say I should use, but I do not get the desired information.
BR, Robert