[Interest] Qbs-built application deployed with macdeployqt doesn't start
Thorbjørn Lindeijer
bjorn at lindeijer.nl
Tue Sep 18 12:22:55 CEST 2018
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.
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/260d20bd693fa816127b2450284c8ca4431fd219/.travis.yml#L128-L131
https://github.com/bjorn/tiled/blob/master/dist/macos/fixup-install-names.rb
> 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.
Cheers,
Bjørn
More information about the Interest
mailing list