Add a define to qmake WITH a value?

Viewed 61426

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?

6 Answers

If you want to define a string literal for use in Objective-C then you need to remember the @ before the escaped quotes

DEFINES += MY_DEF='@\\"string-literal\\"'
Related