[Interest] Qbs-built application deployed with macdeployqt doesn't start
Mitch Curtis
mitch.curtis at qt.io
Tue Sep 18 16:55:44 CEST 2018
Ah, thanks.
So it seems like there’s not much difference between using a shared library or framework in this case.
On 9/18/18, 3:30 PM, "Alexandru Croitor" <alexandru.croitor at qt.io> wrote:
Line 29 disables the Qbs Bundle module functionality, in this case "tiled" will be a shared library "tiled.dylib" instead of a framework "tiled.framework".
Line 30, see http://doc-snapshots.qt.io/qbs/qml-qbsmodules-cpp.html#sonamePrefix-prop , it's equivalent to http://doc.qt.io/qt-5/qmake-variable-reference.html .
If I understand correctly, this is used to set the install_name of the library. The same as the output of the second line of otool -L tiled.dylib, or as set with install_name_tool.
On 18. Sep 2018, at 13:44, Mitch Curtis <mitch.curtis at qt.io> wrote:
-----Original Message-----
From: Interest <interest-bounces+mitch.curtis=qt.io at qt-project.org> On
Behalf Of Mitch Curtis
Sent: Tuesday, 18 September 2018 1:34 PM
To: Thorbjørn Lindeijer <bjorn at lindeijer.nl>; interest at qt-project.org
Subject: Re: [Interest] Qbs-built application deployed with macdeployqt
doesn't start
-----Original Message-----
From: Interest <interest-bounces+mitch.curtis=qt.io at qt-project.org> On
Behalf Of Thorbjørn Lindeijer
Sent: Tuesday, 18 September 2018 12:23 PM
To: interest at qt-project.org
Subject: Re: [Interest] Qbs-built application deployed with
macdeployqt doesn't start
On Tue, Sep 18, 2018, at 10:24, Mitch Curtis wrote:
I’m getting the following error message when trying to launch my
Qbs- built application that has been deployed with macdeployqt:
Dyld Error Message:
Library not loaded: @rpath/QtCore.framework/Versions/5/QtCore
Referenced from: /Volumes/*/slate.app/Contents/MacOS/slate
Reason: image not found
I noticed this was reported already:
https://bugreports.qt.io/browse/QBS-1204
“(Mostly) intended behavior, for the time being.
You can either add an absolute rpath to the Qt libraries using
cpp.rpaths (not recommended), or deploy the Qt libraries into your
application bundle (this will be possible in a future version of Qbs
without any external tools and will be done automatically).”
I assume this is what the first alternative looks like:
https://github.com/bjorn/tiled/blob/master/src/tiled/tiled.qbs#L43
That's a relative RPATH, not an absolute one.
Ah, of course. I tried that and it helped me get a little further, but now I see
that the library
(https://github.com/mitchcurtis/slate/blob/master/lib/lib.qbs) is not
installed into the frameworks directory:
Dyld Error Message:
Library not loaded: slate.framework/Versions/A/slate
Referenced from: /Volumes/*/slate.app/Contents/MacOS/slate
Reason: image not found
Would that have anything to do with the following lines?
https://github.com/bjorn/tiled/blob/master/src/libtiled/libtiled.qbs#L29-L30
I copied your lib's .qbs file when switching to Qbs from qmake, but I was
unsure about some lines so left them commented out...
Oh,
I guess you do that with this:
https://github.com/bjorn/tiled/blob/master/src/libtiled/libtiled.qbs#L136
Then
that makes me curious.. what is the purpose of lines 29 and 30?
Tiled relies on macdeployqt to deploy the Qt libraries into the
application bundle (so the second option). After that, a number of
install names are manually fixed up using a custom script, because
macdeployqt isn't doing it on all executables/libraries:
https://github.com/bjorn/tiled/blob/260d20bd693fa816127b2450284c8ca443
1fd219/.travis.yml#L128-L131
https://github.com/bjorn/tiled/blob/master/dist/macos/fixup-install-
names.rb
Oof. Did you ever report a bug for that?
But what about the recommended way? The comment says it should be
possible, but judging from the fact the problem still exists, I’m
guessing it never got fixed?
Unfortunately Jake left and I guess much of what he planned to do with
Qbs, especially regarding deployment on macOS, still remains to be done.
Damn. Well, I reopened https://bugreports.qt.io/browse/QBS-1204 at least,
because this should be documented.
Cheers,
Bjørn
_______________________________________________
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
_______________________________________________
Interest
mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
More information about the Interest
mailing list