|
From: | Mark Brand |
Subject: | Re: [Mingw-cross-env-list] Qt built with mingw does not define Q_WS_WIN |
Date: | Sat, 27 Mar 2010 22:54:32 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.2pre) Gecko/20100308 SUSE/3.1b1-6.1 Thunderbird/3.1b1 |
After Qt was successfully built, I tried to build my Qt app with it. I have code that needs to work different on Windows, and I check it with:#ifndef Q_WS_WIN // Unix-only code... #endifHowever, the Q_WS_WIN macro is not defined and compilation fails. I'm trying to build the project with:i686-pc-mingw32-qmake makeThis results in the following. Note that the definition of "memicmp" is what Q_WS_WIN is needed for.
It might make sense to check for MinGW since that that is what does or does not provide memicmp. It's not really specific to Qt.
#ifdef __MINGW32__This raises the interesting question of whether Q_WS_WIN should be defined in Qt in mingw-cross-env. We have not missed it yet. The Qt documentation says about it only "Defined on Windows." What "on Windows" means is open to some interpretation, particularly when cross building. I don't know what the answer is.
There is similar ambiguity in the meaning of qmake's "-win32/-unix" options that requires some strange workarounds for cross-building Qt you can see in src/qt.mk.
-Mark
[Prev in Thread] | Current Thread | [Next in Thread] |