Qt Creator的:如何从Win64中说的win32 [英] Qt Creator: how to tell win32 from win64
本文介绍了Qt Creator的:如何从Win64中说的win32的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须做这样的事情在一个.pro文件:
I have to do something like this in a .pro file:
win32 {
LIBS += -L../3rdparty/libusb-win32/lib/msvc -llibusb
} else
win64 {
LIBS += -L../3rdparty/libusb-win32/lib/msvc_x64 -llibusb
}
现在的问题是这是行不通的,它总是链接的Win32库。 有什么建议?
The problem is it doesn't work, it always links win32 library. Any suggestions?
推荐答案
您可以使用 QT_ARCH
变量来检测你的配置是32或64:
You can use QT_ARCH
variable to detect whether your configuration is 32 or 64 :
contains(QT_ARCH, i386) {
message("32-bit")
}else {
message("64-bit")
}
当目标是32位的,变量返回 386
键,如果一个64位的目标它有 x86_64的<值/ code>。
When the target is 32-bit, the variable returns i386
and in case of a 64-bit target it has the value of x86_64
.
这篇关于Qt Creator的:如何从Win64中说的win32的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文