[英]Qt XCode iOS entry point
I am trying to port QT5 application to iOS. 我正在尝试将QT5应用程序移植到iOS。 It builds and runs fine with QtCreator, but now I am trying to make manual XCode project.
它可以使用QtCreator构建并正常运行,但是现在我正在尝试制作手动XCode项目。 Next steps are gatheres from another topics, here is my final path:
下一步是从其他主题中收集的,这是我的最终路径:
It builds and runs, but I got runtime error: 它生成并运行,但是出现运行时错误:
Error: You are creating QApplication before calling UIApplicationMain.
错误:您正在创建QApplication,然后再调用UIApplicationMain。
I've found, that I should replace main -> qtmn, but then I got error about no entry point. 我发现,我应该替换main-> qtmn,但是随后出现关于没有入口点的错误。
The declaration of main is inside of libqios.a, but I am unable to tell linker "Take main() from libqios, not from cpp files." main的声明在libqios.a内部,但是我无法告诉链接器“从libqios中获取main(),而不是cpp文件中。”
I tried it with 我尝试过
-Wl,-force_load,$(QT_SDK)/plugins/platforms/libqios.a - but it does nothing.
I found, that QT preprocessor makes something with object files (renaming main into something others), but it looks too horrible. 我发现,QT预处理器使用目标文件进行处理(将main重命名为其他文件),但是看起来太可怕了。 How can it be solved?
如何解决?
成功的方式是:重命名main-> qtmn(在qt中获得),重建QT,并从我的main()中调用qt_main_wrapper。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.