[Qt-interest] double-click on my application bundle doesn't work

Daniel Price daniel.price at fxhome.com
Fri Dec 4 10:57:19 CET 2009


Aha yes another mac-specific issue. This parameter is used by certain libraries to determine if the app is running in non-bundled mode (GLFW for example). Good catch.

About the mac deploy project - it becomes a big deal when you use Webkit or phonon in your app because of all the dependencies so it's worth using for that. There's nothing to stop you running an additional shell script afterwards for additional mappings (as I do for boost). I know what a time sink it is having to maintain (and debug) those scripts. The mac deploy project is a godsend and makes mac app deployment almost as painless as Windows deployment (a big thing when you consider the resistance to producing mac versions of an existing windows project).

From: nico remy [mailto:nico97492 at gmail.com]
Sent: 04 December 2009 09:51
To: Castagne Nicolas
Cc: Daniel Price; qt-interest at trolltech.com
Subject: Re: [Qt-interest] double-click on my application bundle doesn't work

Hi,

I finally figured what was going wrong, with the help of the Console!
My app runs in text mode if command line arguments are provided (i.e., argc > 1). And when you double click on the bundle, MacOS passes an extra argument to the binary (argc==2), hence the app was starting in text mode and complaining about the incorrect parameters.
Thank you everyone for your help,

Nicolas (definitely a nice name :) )
On Thu, Dec 3, 2009 at 5:33 PM, Castagne Nicolas <nicolascastagne at yahoo.fr<mailto:nicolascastagne at yahoo.fr>> wrote:
Hi Nico (nice name indeed)


@executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml
(compatibility version 4.5.0, current version 4.5.3)
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui
(compatibility version 4.5.0, current version 4.5.3)
What about QtCore, etc ?

Anyhow, there may be other problems in your bundle, such as a missing icon, a missing plist, etc.

The Console is the place to look at, I guess ;

Best-
Nicolas

PS : as for the mac deploy project, it is huge, but it does not appply when having libraries other than qt in the area AFAIK... In this case, a specific script is still needed. That s why I still use my own script.



--- En date de : Jeu 3.12.09, nico remy <nico97492 at gmail.com<mailto:nico97492 at gmail.com>> a écrit :

De: nico remy <nico97492 at gmail.com<mailto:nico97492 at gmail.com>>
Objet: Re: [Qt-interest] double-click on my application bundle doesn't work
À: "Daniel Price" <daniel.price at fxhome.com<mailto:daniel.price at fxhome.com>>
Cc: "qt-interest at trolltech.com<mailto:qt-interest at trolltech.com>" <qt-interest at trolltech.com<mailto:qt-interest at trolltech.com>>
Date: Jeudi 3 Décembre 2009, 13h42

I haven't checked the console, thanks for the tip.
I think I remapped the binary correctly, here is an snippet of otool's
output for the binary:

@executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml
(compatibility version 4.5.0, current version 4.5.3)
@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui
(compatibility version 4.5.0, current version 4.5.3)

I wrote my own script to do the remappings (wasn't aware of the mac
deploy project), and the app works fine if I double click the binary
instead of the bundle.


On Thu, Dec 3, 2009 at 11:34 AM, Daniel Price <daniel..price at fxhome.com<http://mc/compose?to=daniel.price@fxhome.com>> wrote:
> Any error messages in the console? When developing for Mac OS, you MUST keep an eye on the console. Sounds like binary has not been remapped to look for the Qt dylibs.
>
> Did you use the qt mac deploy project?
>
>> -----Original Message-----
>> From: qt-interest-bounces at trolltech.com<http://mc/compose?to=qt-interest-bounces@trolltech.com> [mailto:qt-interest-<mailto:qt-interest->
>> bounces at trolltech.com<http://mc/compose?to=bounces@trolltech.com>] On Behalf Of nico remy
>> Sent: 03 December 2009 10:27
>> To: qt-interest at trolltech.com<http://mc/compose?to=qt-interest@trolltech.com>
>> Subject: [Qt-interest] double-click on my application bundle doesn't
>> work
>>
>> Hi,
>>
>> I have an app that works on Linux and Windows and I am trying to port
>> it to MacOS (using Qt4.5 et Snow Leopard).
>> I created an app bundle, moved the required frameworks in it and
>> played with install_name_tool.
>> If I run the app from a terminal myapp.app/Contents/MacOS/myapp,
>> everything works as expected (the GUI shows up, etc). But if I
>> double-click on the bundle, the icon briefly appears in the dock and
>> disappears, and that's it. If from the Finder, I go into the bundle,
>> into Contents/MacOS and double-click on myapp, it opens a terminal and
>> the GUI.
>> I compiled the app from the command line, using qmake to generate
>> makefiles.
>> Does this look like a common mistake (e.g., something I should add to
>> qmake's CONFIG) ?
>> Thank you for your help,
>>
>> Nicolas
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com<http://mc/compose?to=Qt-interest@trolltech.com>
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com<http://www.avg.com>
>> Version: 9.0.709 / Virus Database: 270.14.89/2539 - Release Date:
>> 12/02/09 19:43:00
>
> This email is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you are not the intended recipient please notify the sender. Please delete the message from all places in your computer where it is stored. You should not copy the email or use it for any purpose or disclose its contents to any other person.To do so may be unlawful. Email is an informal means of communicating and may be subject to data corruption accidentally or deliberately. For this reason it is inappropriate to rely on advice contained in an email without obtaining written confirmation of it first.
>
> FXhome Limited is a limited company registered in England and Wales. Registered number: 04172812. Registered office: The Henderson Business Centre, Ivy Road, Norwich, Norfolk, NR5 8BF, U.K.
>

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com<http://mc/compose?to=Qt-interest@trolltech.com>
http://lists.trolltech.com/mailman/listinfo/qt-interest




No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.709 / Virus Database: 270.14.91/2542 - Release Date: 12/03/09 19:36:00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091204/ecf7d9b8/attachment.html 


More information about the Qt-interest-old mailing list