Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Undefining WIN32 macro for the parser
Is there a way to make the parser undefine WIN32 when working with mingw?
I'm cross-compiling, and I want to have the #ifdef WIN32 grayed out, and the #else white...
I tried DEFINES -= WIN32 and QMAKE_COMPILER_DEFINES -= WIN32
For cross-compiling you should select the appropriate toolchain and qmake mkspec, this should set the correct defines.
Even if I use -spec linux-g++ it still considers WIN32 as defined
I suspect the WIN32 macro to be defined from the compiler toolchain, not from Qt. So you should be sure to have the correct headers for the crosscompiler target in the search path
I removed all #includes, it is still defined...
Hm... strange. I have no idea anymore, maybe sone Creator Troll with more insight to the internals can jump in here.
andre last edited by
I would recommend trying another channel than (just) this forum then though. Perhaps ask on IRC at #qt or even #qt-labs, if #qt doesn't yield anything. I don't see that many Trolls frequenting this forum (though there are some, of course).