[Interest] 5.4.2 Android Misery just one typo away

Scott Aron Bloom scott at towel42.com
Mon Jun 15 19:21:43 CEST 2015


Its not a bug.. and its documented somewhere….

The issue, The QApplication classes, will extract out what they need from argv and adjust the argc appropriately.

The problem with the compilers, is the derived constructor is a valid constructor in its own right.. Its not like a typical virtual function overload.

Scott


From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org] On Behalf Of mark diener
Sent: Monday, June 15, 2015 10:18 AM
To: interest at qt-project.org
Subject: [Interest] 5.4.2 Android Misery just one typo away

Hello list folk:
Under OSX/IOS, no problem.
Under Android, nasty and obscure segment fault
Qt 5.4.2, NDK 10e
Do NOT under any circumstance forget the "&" before the argc parameter on the constructor
if you override QGuiApplication (QApplication too)

Good:

Trpzapp::Trpzapp(int& argc, char** argv) : QGuiApplication(argc,argv)

Bad:

Trpzapp::Trpzapp(int argc, char** argv) : QGuiApplication(argc,argv)

It WILL compile on all the platforms, runs fine on OSX/IOS Simulator, but on Android it will surely DIE.
This maybe is a bug, or maybe just user error that is not caught by the compiler error system. (except maybe a compile warning)


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


More information about the Interest mailing list