Unsolved macOS and macdeployqt: truncated or malformed object (no LC_ID_DYLIB load command in dynamic library filetype)
-
Hi,
Our Mac build server runs a script to make and deploy an application, it's working fine. However, when I run the same script locally on my Mac it fails. It fails during macdeployqt after copying frameworks from Qt/5.12.2/clang_64/lib/ to MyApp.app/Contents/Frameworks/QtQuick.framework/Versions/5/Resources
With a typical error looking like...
ERROR: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: 'MyApp.app/Contents/Frameworks/QtQuick.framework/Versions/5/QtQuick': truncated or malformed object (no LC_ID_DYLIB load command in dynamic library filetype)\n"
See below a simplified version of the build script is below
APP_BUNDLE_NAME=$1 REPO_PATH=$2 SIGNING_ID=$3 QT_BIN_PATH=$4 PATH="$QT_BIN_PATH:$PATH" qmake MyApp.pro -r -spec macx-clang CONFIG+=x86_64 CONFIG+=release DEFINES+=NDEBUG make -j 4 -f Makefile macdeployqt "$APP_BUNDLE_NAME" -qmldir="$REPO_PATH" -verbose=2 -codesign="$SIGNING_ID"
Both Macs are running 10.14.4 (Mojave) and Xcode 10.1. I can't find a reason for my Mac failing. Out of desperation I tried Qt 5.12.1 and tried removing and re-adding 5.12.2, but no joy.
Can anybody see what could be wrong, or suggest a way of debugging the problem?
Thanks in advance
-
Hi,
Does it also happen if you build a default application (both widgets/QtQuick) ?
-
Thanks @SGaist,
Yes, the same happens with both default widgets and QtQuick projects.
Also tried with the -codesign="$SIGNING_ID" option removed, but the problem persists.
-
Since Qt 5.12.3 just got released, can you check with it ?
-
I didn't mention that I tried 5.12.3, with that I get a new error...
qmake MyApp.pro -r -spec macx-clang CONFIG+=x86_64 CONFIG+=release DEFINES+=NDEBUG Could not find qmake spec 'macx-clang'.
Calling with the version option yields...
qmake -v QMake version 3.1 Using Qt version 5.12.3 in /Users/qt/work/install/lib
Note: /Users/qt/work/install/lib doesn't exist on my machine
-
Where exactly is that qmake executable located ?
If you installed Qt using the online installer you should not be able to call qmake like that unless you modified your PATH environment variable.
So you might currently be mixing two different versions of Qt coming from different sources.
-
Apologies @SGaist, that was misleading. That script snippet didn't show the PATH variable being set to ~/Qt/5.12.3/clang_64/bin/.
So, as you say, if I call qmake like that I get ...
qmake
-bash: qmake: command not found -
@mooglus How did you install Qt 5.12.3?
-
Hi @jsulm,
Via the maintenance tool