[Interest] iOS Deployment: QApplication created before UIApplicationMain

Gustavsen Richard Richard.Gustavsen at digia.com
Tue Sep 16 16:45:14 CEST 2014


There is a bugfix for this (qtbase, change 07c0fdf), but I went into Qt-5.4. So we need to backport this to 5.3. You should be able to work around it for now by doing a clean build of your project whenever you change main.

-Richard

________________________________
Fra: Kate Alhola [kate.alhola at gmail.com]
Sendt: 16. september 2014 11:43
Til: Gustavsen Richard
Kopi: Jb Hubert; interest at qt-project.org
Emne: Re: [Interest] iOS Deployment: QApplication created before UIApplicationMain

I start to get this same error os same application when i switched to XCode6 . With Xcode6, app runs first but then for some reason it starts making this even i did not change main at all. This s with xcode project created with qt creator and just normal qt/c++ /QML app. I did not put any fancy linker optimisations anywhere, I just got Qt5.3.2RC and XCode6 to get app running in ios8.

My fix was simple


#ifdef Q_OS_IOS

extern "C" int qtmn(int argc, char *argv[])

#else

int main(int argc, char *argv[])

#endif

Kate

On Mon, Sep 15, 2014 at 4:03 PM, Gustavsen Richard <Richard.Gustavsen at digia.com<mailto:Richard.Gustavsen at digia.com>> wrote:
This could happen if you don't create your Xcode project with qmake. Do you? Or do you manually switch on certain types of optimisations from Xcode?  Another reason for hitting this is if you create a native iOS app, and uses Qt as a third-party library.

Also check the build log in the report navigator in Xcode (the clock symbol in left toolbar), and check that the script "Qt prelink" says: "Renaming '_main' at offset ... to '_qtmn'"

-Richard
________________________________________
Fra: interest-bounces+richard.gustavsen=digia.com at qt-project.org<mailto:digia.com at qt-project.org> [interest-bounces+richard.gustavsen=digia.com at qt-project.org<mailto:digia.com at qt-project.org>] på vegne av Jb Hubert [jb.hubert at dim3.com<mailto:jb.hubert at dim3.com>]
Sendt: 15. september 2014 13:43
Til: interest at qt-project.org<mailto:interest at qt-project.org>
Emne: [Interest] iOS Deployment: QApplication created before    UIApplicationMain

Hello,

I am currently trying to deploy my qtquick application on
iPhoneSimulator (my project run currently well on Desktop and Android).
Compilation and linking causes no problem. When I run the application
from XCode, I encountered this error message:

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.

Environment:

Qt5.2.1 and Qt5.3.1
Xcode 5.1.1
Targeting iOS 5.0

As I have no real practice on Apple environments, does anybody have
some advices concerning this issue?

Thanks in advance.
_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140916/62ca9aeb/attachment.html>


More information about the Interest mailing list