Qt XCode iOS entry point

2019-09-14 20:25发布

问题:

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:

Error: You are creating QApplication before calling UIApplicationMain.

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

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

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. How can it be solved?

回答1:

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



标签: ios xcode qt