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?
qmake will run in win32 mode. In this mode, Windows file naming and path conventions will be used, additionally testing for win32 (as a scope) will succeed. This is the default mode on Windows. -d. qmake will output (hopefully) useful debugging information.
$$PWD means the dir where the current file (. pro or . pri) is. It means the same in LIBS .
qmake.exe is in bin directory of your Qt installation folder (along with all the Qt dlls for deployment). Your compiler should be detected automatically (check the Tools > Options > Build & Run > Compilers tab).
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).
DEFINES += MY_DEF=\\\"String\\\"
This format is to be used when one intends to have the macro replaced by string element
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With