Important: Please read the Qt Code of Conduct -

macdeployqt and how to configure libraries

  • Dear All: I am learning how to use "macdeployqt" to make a "dmg".
    The binary I build originally (and needed to be bundled under MacOS/<binary>) was
    dynamically linked and needed a library under /opt/local/Lib... I can use it under "otool -L".
    And that library is indeed copied under Content/Frameworks after I ran "macdeployqt".

    When I install the DMG to test, the resulting binary is still looking for /opt/local/Lib...for that binary rather than under Content/Frameworks within ".app".

    Sorry if this is a newbie question. I like to know how to configure this properly?
    I have that library inside the ".app/Contents/Framework", should I copied to /usr/local/Lib...
    in the deployed machine? Or should I do something else?

  • Lifetime Qt Champion


    What version of Qt are you using ?
    On what version of macOS ?
    With which version of Xcode ?

  • Qt version -- 5.11.2
    Mac OS -- High Sierra 10.13.6
    Xcode -- 9.4.1

    Are any of these a bit too old?

  • Lifetime Qt Champion

    If you want to nitpick, current version of macOS is Mojave so 10.14 and Xcode is 10.1 but that should not play too much of a role right now.

    What library is giving you trouble ?

    Did you also try to run macdeployqt with verbosity to see if there are some additional information given about your library ?

  • It is Python.

    I am using cython and gcc to compile my python (python-qt) script to a binary.

    The destination machine does have python installed and working. The binary was compiled by gcc with "-lpython3.6m". The destination machine also has that exact version. The when I do "otool -L" on the binary, it is referencing /opt/lib/.../libpython3.6m. That's the path on the original machine where python shared lib is installed. It is still looking at this place in the destination machine?

    Does macdeployqt auto-convert the shared lib to look for them on the deployed machine?

  • I have more data (and error). I got a newer DMG package.

    On the deployed machine, if I run from command line, it works fine.

    If I click on with my mouse and try to run it,
    it would crash and produce the following errors.
    I cannot make of the errors below. Why is there a difference between
    command line vs clicking from the Mac Desktop GUI? I did not set
    any special environment variable

    Process: InspectorBee [96693]
    Path: /Users/USER/Desktop/
    Identifier: InspectorBee
    Version: 0
    Code Type: X86-64 (Native)
    Parent Process: ??? [1]
    Responsible: InspectorBee [96693]
    User ID: 502

    Date/Time: 2018-11-25 14:58:56.642 -0800
    OS Version: Mac OS X 10.14.1 (18B75)
    Report Version: 12
    Anonymous UUID: A1DD61AE-4507-085C-4EA2-36BEFFD2ABC6

    Sleep/Wake UUID: 242C3E45-61C4-490B-841F-4D51E9F7E481

    Time Awake Since Boot: 22000 seconds
    Time Since Wake: 3400 seconds

    System Integrity Protection: enabled

    Crashed Thread: 0 Dispatch queue:

    Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note: EXC_CORPSE_NOTIFY

    Application Specific Information:
    abort() called

    Thread 0 Crashed:: Dispatch queue:
    0 libsystem_kernel.dylib 0x00007fff7c809b86 __pthread_kill + 10
    1 libsystem_pthread.dylib 0x00007fff7c8bfc50 pthread_kill + 285
    2 libsystem_c.dylib 0x00007fff7c7731c9 abort + 127
    3 QtCore 0x000000010cc758a9 qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) + 9
    4 QtCore 0x000000010cc7708f QMessageLogger::fatal(char const*, ...) const + 213
    5 QtGui 0x000000010d82bfe1 QGuiApplicationPrivate::createPlatformIntegration() + 7745
    6 QtGui 0x000000010d82c00b QGuiApplicationPrivate::createEventDispatcher() + 27
    7 QtCore 0x000000010ce3b75a QCoreApplicationPrivate::init() + 1754
    8 QtGui 0x000000010d827309 QGuiApplicationPrivate::init() + 57
    9 QtWidgets 0x000000010de2003a QApplicationPrivate::init() + 26
    10 0x000000010d3ddd88 init_type_QApplication(_sipSimpleWrapper*, _object*, _object*, _object**, _object**, _object**) + 168
    11 0x000000010d1fec4d sipSimpleWrapper_init + 175
    12 org.python.python 0x000000010c32fce9 type_call + 184
    13 InspectorBee 0x000000010c2bacfa 0x10c2b6000 + 19706
    14 InspectorBee 0x000000010c2ba057 0x10c2b6000 + 16471
    15 org.python.python 0x000000010c32065f PyModule_ExecDef + 119
    16 InspectorBee 0x000000010c2b7235 0x10c2b6000 + 4661
    17 InspectorBee 0x000000010c2b7078 main + 823
    18 libdyld.dylib 0x00007fff7c6cb08d start + 1

    Thread 1:
    0 libsystem_pthread.dylib 0x00007fff7c8bc428 start_wqthread + 0
    1 ??? 0x0000000054485244 0 + 1414025796

    Thread 2:
    0 libsystem_pthread.dylib 0x00007fff7c8bc428 start_wqthread + 0
    1 ??? 0x0000000054485244 0 + 1414025796

    Thread 0 crashed with X86 Thread State (64-bit):
    rax: 0x0000000000000000 rbx: 0x000000010ddeb5c0 rcx: 0x00007ffee39491f8 rdx: 0x0000000000000000

  • Lifetime Qt Champion

    Are you using PyQt ?

    IIRC, both don't necessarily start with the same working path but it should make your application crash like that in any case.

Log in to reply