[Interest] iOS Deployment: QApplication created before UIApplicationMain

Kate Alhola kate.alhola at gmail.com
Tue Sep 16 11:43:19 CEST 2014


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> 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
> [interest-bounces+richard.gustavsen=digia.com at qt-project.org] på
> vegne av Jb Hubert [jb.hubert at dim3.com]
> Sendt: 15. september 2014 13:43
> Til: 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
> http://lists.qt-project.org/mailman/listinfo/interest
> _______________________________________________
> Interest mailing list
> 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/56eb46e8/attachment.html>


More information about the Interest mailing list