[Qt-creator] #ifdef Linux - code coloring

Nikolai Kosjar nikolai.kosjar at theqtcompany.com
Mon Sep 14 16:02:52 CEST 2015



On 09/09/2015 10:20 AM, Charalambos wrote:
> Eike Ziller <eike.ziller at ...> writes:
>
>> Hm, I can reproduce that when setting a Qt from the mingw 4.5.1
>> packages.
>> You can work around the problem by making sure that your MinGW\bin
>> path is in your PATH variable.
>> Everywhere in QtCreator we add the correct mingw path to commands that
>> are called from creator, except when determining the toolchains
>> defines and include paths...
>> Thank you a lot!
>>
>> ++ Eike
>>
>
> Hi Eike,
>
> I am having the same problem. I am running Qt 5.5 with mingw32_492 compiler
> and Q_OS_WIN or WIN32 or WIN64 are not set for me. How can i resolve this issue?
>
> I read your answer but i have to say my PATH variable already contains the
> full path to the compiler. Any ideas on how to resolve my problem?

What's your build system / project type?

Seems to work fine here with the Qt Creator from the Qt 5.5 mingw32_492 
package using that Kit:
1. Create a "Qt Console Application" from the Wizard
2. Add to main.cpp:

--8<--------------------
#ifdef Q_OS_WIN
void defined_Q_OS_WIN;
#endif

#ifdef WIN32
void defined_WIN32;
#endif

#ifdef WIN64
void defined_WIN64;
#endif
--8<--------------------

Only the code for WIN64 is greyed out.

Nikolai



More information about the Qt-creator mailing list