Add a define to qmake WITH a value?

Jake Petroules picture Jake Petroules · Jul 28, 2010 · Viewed 55.1k times · Source

How do I add a define with qmake WITH a value:

For example, this does not work (as I expected) in my .pro file:

DEFINES += WINVER 0x0500

nor

DEFINES += "WINVER 0x0500"

How do I define WINVER as 0x0500 before anything starts compiling so it's definition is not affected in any way by compilation or include order?

Answer

Greg S picture Greg S · Jul 28, 2010

DEFINES += "WINVER=0x0500" works for me.

This way, -DWINVER=0x0500 is added to the command line of the compiler, which is the syntax GCC/mingw expects for command line preprocessor definitions (see here for the details).