title: Qt 5.4 application bundled for OSX crashes when launched
body: <p>I've been trying to bundle my Qt application as an OSX <code>.app</code> but encountered weird crashing right when I launch the bundled app.
  The application uses QtCore, QtGui, QtNetwork, QtWidgets, QtMultimedia and QtOpenGL frameworks, and Jack Audio Connection Kit as a dylib.</p>
  <p>I added all following into <code>xxx.app/Content/Frameworks/</code> and did <code>name_install_tool</code> to make sure everything is searched from <code>@executable_path/../Frameworks/</code> and linking each of the frameworks to each other likewise.</p>
  <p>When doing <code>otool -L</code> to the <code>xxx.app/Content/MacOs/xxx</code>  I get the following:</p>
  <pre><code>@executable_path/../Frameworks/libjack.0.dylib (compatibility version 1.0.0, current version 1.0.0)
  @executable_path/../Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia (compatibility version 5.4.0, current version 5.4.0)
  @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.4.0, current version 5.4.0)
  @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.4.0, current version 5.4.0)
  /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
  /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
  @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.4.0, current version 5.4.0)
  @executable_path/../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.4.0, current version 5.4.0)
  @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.4.0, current version 5.4.0)
  /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
  /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
  /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
  </code></pre>
  <p>Which would imply everything is ok, but when I run the bundled app separated from the development environment, The application crashes:</p>
  <pre><code>Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
  0   libsystem_kernel.dylib          0x00007fff8fca9866 __pthread_kill + 10
  1   libsystem_pthread.dylib         0x00007fff85c9a35c pthread_kill + 92
  2   libsystem_c.dylib               0x00007fff85670b1a abort + 125
  3   org.qt-project.QtCore           0x0000000109819159 qt_message_fatal(QtMsgType, QMessageLogContext const&amp;, QString const&amp;) + 9
  4   org.qt-project.QtCore           0x000000010981a611 QMessageLogger::fatal(char const*, ...) const + 161
  5   org.qt-project.QtGui            0x0000000109e13307 QGuiApplicationPrivate::createPlatformIntegration() + 6359
  6   org.qt-project.QtGui            0x0000000109e1332b QGuiApplicationPrivate::createEventDispatcher() + 27
  7   org.qt-project.QtCore           0x0000000109a34b11 QCoreApplication::init() + 113
  8   org.qt-project.QtCore           0x0000000109a34a87 QCoreApplication::QCoreApplication(QCoreApplicationPrivate&amp;) + 39
  9   org.qt-project.QtGui            0x0000000109e1079e QGuiApplication::QGuiApplication(QGuiApplicationPrivate&amp;) + 14
  10  org.qt-project.QtWidgets        0x000000010a43653e QApplication::QApplication(int&amp;, char**, int) + 206
  </code></pre>
  <p>And not crashing from missing frameworks or dylibs. The program works fine when running on development machine with Qt frameworks searched from <code>/Users/xxx/Qt/5.4/clang_64/lib</code>.</p>
  <p>Also running the program so that only libjack dylib is searched from <code>@executable_path/../Frameworks/</code> and Qt libs from <code>/Users/xxx/Qt/..</code> works fine. So it's not libjack (perhaps).</p>
  <p>If there is some framework/lib loading during runtime, how could I find out what? But then again, it should link to <code>/Users/xxx/Qt/...</code> and work?</p>