Important: Please read the Qt Code of Conduct -

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

    With a typical error looking like...

    ERROR: "/Applications/ '': 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

    qmake -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

  • Lifetime Qt Champion


    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.

  • Lifetime Qt Champion

    Since Qt 5.12.3 just got released, can you check with it ?

  • @SGaist

    I didn't mention that I tried 5.12.3, with that I get a new error...

    qmake -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

  • Lifetime Qt Champion

    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 ...

    -bash: qmake: command not found

  • Lifetime Qt Champion

    @mooglus How did you install Qt 5.12.3?

  • Hi @jsulm,

    Via the maintenance tool

Log in to reply