Qt XCode iOS 入口点 [英] Qt XCode iOS entry point

查看:22
本文介绍了Qt XCode iOS 入口点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 QT5 应用程序移植到 iOS.它使用 QtCreator 构建和运行良好,但现在我正在尝试制作手动 XCode 项目.接下来的步骤是从其他主题中收集的,这是我的最终路径:

I am trying to port QT5 application to iOS. It builds and runs fine with QtCreator, but now I am trying to make manual XCode project. Next steps are gatheres from another topics, here is my final path:

它构建并运行,但出现运行时错误:

It builds and runs, but I got runtime error:

错误:您在调用 UIApplicationMain 之前创建了 QApplication.

Error: You are creating QApplication before calling UIApplicationMain.

我发现,我应该替换 main -> qtmn,但后来我收到了关于没有入口点的错误.

I've found, that I should replace main -> qtmn, but then I got error about no entry point.

main 的声明在 libqios.a 中,但我无法告诉链接器从 libqios 中获取 main(),而不是从 cpp 文件中获取."

The declaration of main is inside of libqios.a, but I am unable to tell linker "Take main() from libqios, not from cpp files."

我试过了

 -Wl,-force_load,$(QT_SDK)/plugins/platforms/libqios.a - but it does nothing.

我发现,QT 预处理器使用目标文件制作了一些东西(将 main 重命名为其他文件),但它看起来太可怕了.怎么解决?

I found, that QT preprocessor makes something with object files (renaming main into something others), but it looks too horrible. How can it be solved?

推荐答案

Succeeded in: 重命名 main -> qtmn(在 qt 中),重建 QT,并从我的 main() 中调用 qt_main_wrapper.

Succeeded in by: renaming main -> qtmn (in qt sourced), rebuilt QT, and called qt_main_wrapper from my main().

这篇关于Qt XCode iOS 入口点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆