Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. macOS and macdeployqt: truncated or malformed object (no LC_ID_DYLIB load command in dynamic library filetype)
Forum Update on Monday, May 27th 2025

macOS and macdeployqt: truncated or malformed object (no LC_ID_DYLIB load command in dynamic library filetype)

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mooglus
    wrote on last edited by mooglus
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Does it also happen if you build a default application (both widgets/QtQuick) ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Does it also happen if you build a default application (both widgets/QtQuick) ?

        M Offline
        M Offline
        mooglus
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

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

            M Offline
            M Offline
            mooglus
            wrote on last edited by
            #5

            @SGaist

            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

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 1 Reply Last reply
              0
              • SGaistS SGaist

                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.

                M Offline
                M Offline
                mooglus
                wrote on last edited by mooglus
                #7

                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

                jsulmJ 1 Reply Last reply
                0
                • M mooglus

                  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

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @mooglus How did you install Qt 5.12.3?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  M 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @mooglus How did you install Qt 5.12.3?

                    M Offline
                    M Offline
                    mooglus
                    wrote on last edited by
                    #9

                    Hi @jsulm,

                    Via the maintenance tool

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved