加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c++ 为iOS创建Qt 5.1应用程序

发布时间:2020-12-15 01:48:40 所属栏目:百科 来源:网络整理
导读:新的Qt 5.1具有(部分)支持iOS,如 release announcement所述,但我如何实际构建和部署Qt项目到iOS设备?或者换句话说,我如何最终得到iOS XCode项目? 解决方法 这显示了如何为iOS模拟器编译qt5. 基于qt build instructions for iOS. 如果要为iOS设备构建,则必
新的Qt 5.1具有(部分)支持iOS,如 release announcement所述,但我如何实际构建和部署Qt项目到iOS设备?或者换句话说,我如何最终得到iOS XCode项目?

解决方法

这显示了如何为iOS模拟器编译qt5.

基于qt build instructions for iOS.

如果要为iOS设备构建,则必须再次将qt5源检出到第二个目录,并使用alternate configure命令,如下所示.

这使用qt 5.2 beta 1.使用git标签检查更新的版本.

git clone git://gitorious.org/qt/qt5.git qt5-ios-simulator.git
cd qt5-ios-simulator.git
git tag
git reset --hard v5.2.0-beta1

初始化qt但不使用webkit,因为编译需要很长时间

perl init-repository --no-webkit

配置qt以使用带模拟器的开源版本,跳过示例和测试

./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests -sdk iphonesimulator

或者,在单独的git checkout中使用此configure命令为iOS设备构建

./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests

运行make.并行使用4个作业以加快编译速度.

make -j 4
cd ..

完成.

您可以通过构建示例项目来测试一切是否正常

git clone https://github.com/msorvig/qt-ios-demo.git
cd qt-ios-demo
../qt5-ios-simulator.git/qtbase/bin/qmake 
open qt-ios-demo.xcodeproj

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读