Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
6.0.0
-
None
-
macOS v11.1
Description
I am building an application using Qt/QML with cmake. These are the packages I am using:
find_package (Qt6 COMPONENTS Core Qml Quick Svg REQUIRED)
I am generating a DMG installer with macdeploy with the command below
add_custom_target(pack COMMAND ${CMAKE_PREFIX_PATH}/bin/macdeployqt ${PROJECT_NAME}.app -qmldir=${CMAKE_SOURCE_DIR}/qml -no-strip -dmg)
After installation the application fails to start with the error below
QQmlApplicationEngine failed to load component
qrc:/qml/main.qml:2:1: Cannot load library /Applications/wol.app/Contents/PlugIns/quick/libqtquickcontrols2plugin.dylib: (dlopen(/Applications/wol.app/Contents/PlugIns/quick/libqtquickcontrols2plugin.dylib, 133): Library not loaded: @rpath/QtQuickControls2Impl.framework/Versions/A/QtQuickControls2Impl
Referenced from: /Applications/wol.app/Contents/PlugIns/quick/libqtquickcontrols2plugin.dylib
Reason: image not found)
Manually copying QtQuickControls2Impl.framework in wol.app/Contents/Frameworks before generating the dmg solves this problem