Qt Creator:如何区分 win32 和 win64

编程入门 行业动态 更新时间:2024-10-21 15:30:10
本文介绍了Qt Creator:如何区分 win32 和 win64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我必须在 .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 位时,变量返回 i386,如果是 64 位目标,它的值为 x86_64.

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:如何区分 win32 和 win64

本文发布于:2023-11-06 06:46:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562975.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Creator   Qt

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!