[Interest] Qbs-built application deployed with macdeployqt doesn't start
Mitch Curtis
mitch.curtis at qt.io
Tue Sep 18 13:34:24 CEST 2018
> -----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...
> 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
More information about the Interest
mailing list