Home > database >  Qt Creator Release Build Quit Unexpectedly
Qt Creator Release Build Quit Unexpectedly

Time:05-08

After compiling any version (Debug and Release) of the application with Qt Creator, it only runs from under Qt Creator with the option: "Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH".

I try compilation and use macdeployqt for creation dmg. App after start crash: "Quit Unexpectedly" because can't find libraries:

enter image description here

otool result:

enter image description here

App Contents/Frameworks after macdeployqt:

enter image description here

How to deploy app on Qt and run after compilation? How set rpath?

CodePudding user response:

I found solution, macdeployqt not copy all required libraries and some files to App, need manually copy to:

Plugins

  1. cp -r $QT_MACOS_PATH/Plugins/ to App/Contents/Plugins/

Resources/qml

  1. mkdir App/Contents/Resources/qml
  2. cp -r $QT_MACOS_PATH/qml/ to App/Contents/Resources/qml/

Frameworks

  1. cp -r $QT_MACOS_PATH/lib/*.framework to App/Contents/Frameworks

Then you can use macdeployqt for your application (Optional):

  1. macdeployqt *.app

Now you can run your application. You can set path to Qt with your installer for distribution in App/Contents/Resources/qt.conf and not copy them all.

Of course, it is better not to do this, otherwise the size of the application will be very large. This only applies to the test poligon. For distribution, create an installer.

  • Related