I am currently trying to compile a QT based project on IOS. I am using cmake to create and configure the .xcodeproject and xcode to run the app on the device.
I succeed to remove all the previous linker error and now i am dealing with the entry point.
My main.cpp looks like that
int main(int argc, char **argv) {
QApplication app(argc, argv);
return app.exec();
}
this got me the following error:
Error: You are creating QApplication before calling UIApplicationMain. If you are writing a native iOS application, and only want to use Qt for parts of the application, a good place to create QApplication is from within 'applicationDidFinishLaunching' inside your UIApplication delegate.
I found on this post that you should rename the main and qt will do the job for you and launch the application life cycle
Run-time error for Qt application on ios built via CMake
#if defined(Q_OS_IOS)
extern "C" int qtmn(int argc, char** argv) {
#else
int main(int argc, char **argv) {
#endif
QApplication app(argc, argv);
return app.exec();
}
but now i am dealing with this error
ld: entry point (_main) undefined. for architecture arm64
In the first post they say that i should have a your/qt/root/path/mkspecs/macx-ios-clang/rename_main.sh script
I got none, in the other post the answer says to:
renaming main -> qtmn (in qt sourced), rebuilt QT, and called qt_main_wrapper from my main().
but I don't know what sould i do with the "rebuilt and called qt_main_wrapper"