Qt6.7.2编译后无法运行
Closed this issue · 2 comments
MoonBite666 commented
- 平台:Windows11/Ubuntu22.04
- Qt版本:6.7.2
- 使用编译器:mingw_64/gcc
- 编译过程
$git clone https://github.com/mentalfl0w/RibbonUI.git --recursive
$cd RibbonUI
$mkdir build
$cd build
$cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=C:\Qt\6.7.2\mingw_64 -DCMAKE_C_COMPILER:FILEPATH=C:/Qt/Tools/mingw1120_64/bin/gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:/Qt/Tools/mingw1120_64/bin/g++.exe -DCMAKE_BUILD_TYPE=Release -GNinja ..
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Qt/Tools/mingw1120_64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Configuring qmsetup...
-- Building qmsetup (Release)...
-- Installing qmsetup (Release)...
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
---------------------------- RibbonUI ----------------------------
Build RibbonUI APP: ON
Build RibbonUI static library: OFF
Build QWindowKit: ON
Universal build RibbonUI for macOS: OFF
RibbonUI QML Plugin Path: C:/Qt/6.7.2/mingw_64/qml/RibbonUI
------------------------------------------------------------------
-- Configuring done (10.2s)
-- Generating done (0.3s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_C_COMPILER
-- Build files have been written to: C:/Users/MoonFeather/codings/RibbonUI/build
$cmake --build . --target all --config Release --parallel
[86/216] Automatic QML type registration for target RibbonUI
Warning: platformsupport.h:: PlatformSupport is registered multiple times by the following C++ classes: PlatformSupport, PlatformSupport
Warning: ribbonui.h:: RibbonUI is registered multiple times by the following C++ classes: RibbonUI, RibbonUI
Warning: ribbontheme.h:: RibbonTheme is registered multiple times by the following C++ classes: RibbonTheme, RibbonTheme
[148/216] Building CXX object lib_source/CMakeFiles/RibbonUI.dir/ribbonui.cpp.obj
C:/Users/MoonFeather/codings/RibbonUI/lib_source/ribbonui.cpp: In static member function 'static void RibbonUI::init()':
C:/Users/MoonFeather/codings/RibbonUI/lib_source/ribbonui.cpp:39:39: warning: 'Qt::AA_EnableHighDpiScaling' is deprecated: High-DPI scaling is always enabled. This attribute no longer has any effect. [-Wdeprecated-declarations]
39 | QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/Qt/6.7.2/mingw_64/include/QtCore/qbytearray.h:9,
from C:/Qt/6.7.2/mingw_64/include/QtCore/qstringview.h:8,
from C:/Qt/6.7.2/mingw_64/include/QtCore/qchar.h:656,
from C:/Qt/6.7.2/mingw_64/include/QtCore/qstring.h:14,
from C:/Qt/6.7.2/mingw_64/include/QtQml/qjsprimitivevalue.h:10,
from C:/Qt/6.7.2/mingw_64/include/QtQml/qqmlprivate.h:18,
from C:/Qt/6.7.2/mingw_64/include/QtQml/qqml.h:7,
from C:/Qt/6.7.2/mingw_64/include/QtQuick/qquickitem.h:8,
from C:/Qt/6.7.2/mingw_64/include/QtQuick/QQuickItem:1,
from C:/Users/MoonFeather/codings/RibbonUI/lib_source/ribbonui.h:4,
from C:/Users/MoonFeather/codings/RibbonUI/lib_source/ribbonui.cpp:1:
C:/Qt/6.7.2/mingw_64/include/QtCore/qnamespace.h:449:9: note: declared here
449 | AA_EnableHighDpiScaling Q_DECL_ENUMERATOR_DEPRECATED_X(
| ^~~~~~~~~~~~~~~~~~~~~~~
[216/216] Linking CXX executable app\release\RibbonUI-APP.exe
$cd .\app\release\
$C:\Qt\6.7.2\mingw_64\bin\windeployqt.exe .\RibbonUI-APP.exe
- 错误情况:部署完成后启动应用,没有任何反应
- Ubuntu下编译返回和上面相似的信息,启动应用后报错:
> ./RibbonUI-APP
QQmlApplicationEngine failed to load component
qrc:/qt/qml/RibbonUIAPP/example.qml:8:1: Type RibbonWindow unavailable
qrc:/qt/qml/RibbonUI/RibbonWindow.qml:84:9: Type RibbonTitleBar unavailable
qrc:/qt/qml/RibbonUI/RibbonTitleBar.qml:142:13: Type RibbonButton unavailable
qrc:/qt/qml/RibbonUI/RibbonButton.qml:126:9: Type RibbonToolTip unavailable
qrc:/qt/qml/RibbonUI/RibbonToolTip.qml:3:1: module "Qt5Compat.GraphicalEffects" is not installed
mentalfl0w commented
你好,按照报错信息,有一个Qt模块没有安装:`qt5compat`,把这个安装上就可以了
发自我的 iPhone
… 在 2024年7月26日,10:33,MoonFeather ***@***.***> 写道:
Qt5Compat.GraphicalEffects
MoonBite666 commented
Linux下安装缺失库可以解决问题,Windows下例程还需要进行额外的部署操作才能正常运行,已在pr内补全
#2