Qt6第二个LTS出来了,周日找时间安装并测试了Qt6.5LTS,安装我是按我之前的一个博客记录来做的,用的是国内境像,顺利快速安装完成,下面是设置的过程关键总结。
一、Devices
Android设备(Device)选择
二、Kits
(一)新机(64位系统)选arm64-v8a,性能优,不要选v7a,性能会低。
“专门针对下“SDK Manager"注解下
(二)Android Qt 工具链设置
三、xxx.cmake
(1)如果提示下面错误(cmake过程出现)
问题: C:\Qt6_5LTS\6.5.1\android_arm64_v8a\lib\cmake\Qt6BuildInternals\QtBuildInternalsExtra.cmake:45: error: Syntax error in cmake code at C:/Qt6_5LTS/6.5.1/android_arm64_v8a/lib/cmake/Qt6BuildInternals/QtBuildInternalsExtra.cmake:45 when parsing string C:\Qt6_5LTS Invalid character escape '\Q'. C:/Qt6_5LTS/6.5.1/android_arm64_v8a/lib/cmake/Qt6BuildInternals/Qt6BuildInternalsConfig.cmake:54 (include) C:/Qt6_5LTS/6.5.1/android_arm64_v8a/lib/cmake/Qt6/Qt6Config.cmake:157 (find_package) CMakeLists.txt:14 (find_package)
思考:
根据提示进入“QtBuildInternalsExtra.cmake”,观察“:\Qt6_5LTS”,对比同一文件中的路径,怀疑是“转义符问题造成”。下面蓝色字体为实际xxx.cmake文件的摘录
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND
NOT QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX
AND NOT QT_SUPERBUILD)
set(qtbi_orig_prefix "C:\Qt6_5LTS")
set(qtbi_orig_staging_prefix "C:/Qt6_5LTS/6.5.1/android_arm64_v8a")
尝试(qPass):
把"\",改为“/”,问题解决;也即:set(qtbi_orig_prefix "C:/Qt6_5LTS")