一.准备环境:
操作系统:
Windows7 x64wince上的Qt库版本:
- 版本编译失败:qt-everywhere-opensource-src-4.8.6.zip
- 版本编译成功:qt-everywhere-opensource-src-4.7.3.zip
Windows CE 6.0
VS2008
qt在windows下面的sdk:
qt-opensource–windows-x86-msvc2013_64.opengl-5.3.1.exe
或者:(没影响)
qt-win-opensource-4.7.3-vs2008.exeWinCE6.0 SDK:
Windows Mobile 6 Standard SDK Refresh.msi
根据需要决定是否安装WinCE6.0补丁如果是非官方版SDK,可自行安装:
WINCE6.0_CHS_SDK.msiQt在Visual Studio上的插件:
qt-vs-addin-1.1.10.exe
二. 配置Qt:
- 创建新的目录C:\Qt\qt4.7.3-wince60, 解压qt-everywhere-opensource-src-4.7.3.zip到该目录下
Note: 新建的目录中不能有空格 - 打开C:\Qt\qt4.7.3-wince60\mkspecs
- 按照按文件夹下的命名规则 :
wince<version><SDK-shortcut>-[architecture]-msvc2005
<\br> - 新建子文件夹 wince60chsint-armv4i-msvc2008
- 复制名字近似的mkspec子目录下的qmake.conf和qplatformdefs.h文件到该新建的文件夹中
- 打开qmake.conf文件修改一下两个参数:
- CE_SDK 指定SDK的名字 (specifies the name of the SDK)
- CE_ARCH 指定目标架构的平台 (specifies information about the target architecture)
- 修改如下:
CE_SDK = WINCE6.0_CHS_SDK # replace with actual SDK name
CE_ARCH = ARMV4I
- 添加系统环境变量C:\qt\qt4.7.3-wince60\bin
使用管理员权限打开VS2008 Command Prompt,运行命令
configure -platform win32-msvc2008 -xplatform wince60chsint-armv4i-msvc2008
Note:
不使用管理员权限可能会提示复制mkspec失败
提示选择Qt的版本时Type ‘c’ if you want to use the Commercial Edition.
Type ‘o’ if you want to use the Open Source Edition.输入
o
,表示使用开源版本。或者可以在configure命令中加上参数-opensource
,则不会出现该提示。This is the Qt for Windows CE Open Source Edition.
You are licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) version 2.1
or the GNU General Public License (GPL) version 3.Type ‘3’ to view the GNU General Public License version 3 (GPLv3).
Type ‘L’ to view the Lesser GNU General Public License version 2.1 (LGPLv2.1).
Type ‘y’ to ac