本文介绍了用一个值向 qmake 添加一个定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用带有值的 qmake 添加定义:
How do I add a define with qmake WITH a value:
例如,这在我的 .pro 文件中不起作用(如我所料):
For example, this does not work (as I expected) in my .pro file:
DEFINES += WINVER 0x0500
也没有
DEFINES += "WINVER 0x0500"
如何在开始编译之前将 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?
推荐答案
DEFINES += "WINVER=0x0500"
对我有用.
这样,-DWINVER=0x0500
被添加到编译器的命令行中,这是GCC/mingw期望的命令行预处理器定义的语法(参见此处 了解详情).
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).
这篇关于用一个值向 qmake 添加一个定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!