Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P2: Important
-
Resolution: Duplicate
-
Affects Version/s: 6.0.0
-
Fix Version/s: None
-
Component/s: Build tools: macdeployqt
-
Labels:None
-
Environment:macOS v11.1
-
Platform/s:
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