macdeployqt again
-
Hi all,
I'm trying to use macdeployqt on my Qt app (Qt 5.15.18), but it seems to have issues with transitive dependencies. It copies libraries into my bundle, but not libraries the library itself depends on. Is that a known issue?
For example It finds outlibwebpmux.3.dylibis needed and copies it from/usr/local/lib/into the bundle. (Surprisingly underContents/Frameworksbut anyway.)
Now, when I start my bundled app it crashes and in the Console app I see a crash log with the following lines:Termination Reason: Namespace DYLD, Code 1 Library missing Library not loaded: @rpath/libsharpyuv.0.dylib Referenced from: MyApp.app/Contents/Frameworks/libwebpmux.3.dylib Reason: tried: 'MyApp.app/Contents/Frameworks/../lib/libsharpyuv.0.dylib' (no such file), 'MyApp.app/Contents/Frameworks/../lib/libsharpyuv.0.dylib' (no such file), 'MyApp.app/Contents/Frameworks/libsharpyuv.0.dylib' (no such file), 'MyApp.app/Contents/Frameworks/libsharpyuv.0.dylib' (no such file), '/usr/lib/libsharpyuv.0.dylib' (no such file, not in dyld cache)When I execute
otool -L MyApp.app/Contents/Frameworks/libwebpmux.3.dylibit says:MyApp.app/Contents/Frameworks/libwebpmux.3.dylib: @executable_path/../Frameworks/libwebpmux.3.dylib (compatibility version 5.0.0, current version 5.0.0) @rpath/libwebp.7.dylib (compatibility version 9.0.0, current version 9.9.0) @rpath/libsharpyuv.0.dylib (compatibility version 2.0.0, current version 2.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)So it seems
libwebpmux.3.dylibdepends onlibsharpyuv.0.dylib. But that didn't find its way into the bundle. How can I fix this? -
Hi,
The first thing you can do is try with a more recent version of macdeployqt from Qt 6 to check if it does things better.
Otherwise, use a bash script to copy and update the dependencies. -
Hi,
The first thing you can do is try with a more recent version of macdeployqt from Qt 6 to check if it does things better.
Otherwise, use a bash script to copy and update the dependencies.@SGaist Hi, I already did. But it doesn't work, it says:
dyld[50080]: Library not loaded: @rpath/QtCore.framework/Versions/A/QtCore Referenced from: <66AAD100-9E8A-35A8-B6DD-D1509FAEBAE6> ./macdeployqt Reason: tried: '../lib/QtCore.framework/Versions/A/QtCore' (no such file), '../lib/QtCore.framework/Versions/A/QtCore' (no such file) [1] 50080 abort ./macdeployqtIn Qt 6 the
QtCoreframework is in../lib/QtCore.framework/Versions/A/, but unfortunately in Qt 5 its in../lib/QtCore.framework/Versions/5/or../lib/QtCore.framework/Versions/Current/. -
Worth a shot.
Did you run macdeployqt in verbose mode to check if there was any error message regarding the missing libraries ?
-
Worth a shot.
Did you run macdeployqt in verbose mode to check if there was any error message regarding the missing libraries ?
@SGaist Yes, it said libwebpmux depends on libsharpyuv but it didn't try to copy that one over. I found out libwebpmux is a dependency of a freerdp3 we use. So it seems macdeployqt either wasn't made for 3rd party libraries or it fails to handle them. It looks like I need to handle those dependencies by myself somehow.