Qt 6.8.0 Beta2 wasm-ld: error: unable to find library -lQmlModels
Unsolved
Qt for WebAssembly
-
I installed Qt6.8.0 Beta2, but encountered errors when compiling the project. Does anyone know how to solve this? It seems to be a library linking issue, and my environment is Win10 / emsdk 3.1.50.
em++: error: 'C:/Develop/emsdk/upstream/bin\wasm-ld.exe -o ./JQRing.wasm C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledFreetype.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledLibpng.a jqwebcommon.obj main.obj jqring.js_plugin_import.obj jqring.js_qml_plugin_import.obj qrc_jqwebcommonfonts.obj qrc_qml.obj qrc_images.obj C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/QWasmIntegrationPlugin_resources_1/.qt/rcc/qrc_wasmfonts_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/QWasmIntegrationPlugin_resources_2/.qt/rcc/qrc_wasmwindow_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Gui_resources_1/.qt/rcc/qrc_qpdf_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Gui_resources_2/.qt/rcc/qrc_gui_shaders_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/plugins/platforms/libqwasm.a C:/Qt/6.8.0/wasm_singlethread/plugins/iconengines/libqsvgicon.a C:/Qt/6.8.0/wasm_singlethread/plugins/imageformats/libqgif.a C:/Qt/6.8.0/wasm_singlethread/plugins/imageformats/libqico.a C:/Qt/6.8.0/wasm_singlethread/plugins/imageformats/libqjpeg.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledLibjpeg.a C:/Qt/6.8.0/wasm_singlethread/plugins/imageformats/libqsvg.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6Svg.a C:/Qt/6.8.0/wasm_singlethread/plugins/tls/libqcertonlybackend.a C:/Qt/6.8.0/wasm_singlethread/qml/QtQuick/Controls/objects-Release/QuickControls2_resources_1/.qt/rcc/qrc_qmake_QtQuick_Controls_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/QtQuick/Templates/objects-Release/QuickTemplates2_resources_1/.qt/rcc/qrc_qmake_QtQuick_Templates_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/QtQuick/objects-Release/Quick_resources_1/.qt/rcc/qrc_qmake_QtQuick_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_2/.qt/rcc/qrc_scenegraph_shaders_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_3/.qt/rcc/qrc_scenegraph_curve_shaders_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_4/.qt/rcc/qrc_scenegraph_curve_shaders_derivatives_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_5/.qt/rcc/qrc_scenegraph_curve_shaders_lg_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_6/.qt/rcc/qrc_scenegraph_curve_shaders_lg_derivatives_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_7/.qt/rcc/qrc_scenegraph_curve_shaders_rg_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_8/.qt/rcc/qrc_scenegraph_curve_shaders_rg_derivatives_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_9/.qt/rcc/qrc_scenegraph_curve_shaders_cg_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_10/.qt/rcc/qrc_scenegraph_curve_shaders_cg_derivatives_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_11/.qt/rcc/qrc_scenegraph_curve_shaders_tf_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/Quick_resources_12/.qt/rcc/qrc_scenegraph_curve_shaders_tf_derivatives_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/QtQml/objects-Release/QmlMeta_resources_1/.qt/rcc/qrc_qmake_QtQml_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/QtQml/Models/objects-Release/QmlModels_resources_1/.qt/rcc/qrc_qmake_QtQml_Models_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/QML/objects-Release/Qml_resources_1/.qt/rcc/qrc_qmake_QML_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/libQt6QuickControls2.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6QuickTemplates2.a C:/Qt/6.8.0/wasm_singlethread/qml/QtQuick/libqtquick2plugin.a C:/Qt/6.8.0/wasm_singlethread/qml/QtQml/libqmlplugin.a -lQmlModels C:/Qt/6.8.0/wasm_singlethread/qml/QtQml/Models/libmodelsplugin.a C:/Qt/6.8.0/wasm_singlethread/qml/QtQuick/Window/objects-Release/quickwindow_resources_1/.qt/rcc/qrc_qmake_QtQuick_Window_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/QtQuick/Window/libquickwindowplugin.a C:/Qt/6.8.0/wasm_singlethread/qml/Qt5Compat/GraphicalEffects/objects-Release/qtgraphicaleffectsplugin_resources_1/.qt/rcc/qrc_qmake_Qt5Compat_GraphicalEffects_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/Qt5Compat/GraphicalEffects/objects-Release/qtgraphicaleffectsplugin_resources_2/.qt/rcc/qrc_qtgraphicaleffectsplugin_raw_qml_0_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/lib/objects-Release/qtgraphicaleffectsplugin_resources_3/.qt/rcc/qrc_qtgraphicaleffectsshaders_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/Qt5Compat/GraphicalEffects/libqtgraphicaleffectsplugin.a C:/Qt/6.8.0/wasm_singlethread/qml/Qt5Compat/GraphicalEffects/private/objects-Release/qtgraphicaleffectsprivate_resources_1/.qt/rcc/qrc_qmake_Qt5Compat_GraphicalEffects_private_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/Qt5Compat/GraphicalEffects/private/objects-Release/qtgraphicaleffectsprivate_resources_2/.qt/rcc/qrc_qtgraphicaleffectsprivate_raw_qml_0_init.cpp.o C:/Qt/6.8.0/wasm_singlethread/qml/Qt5Compat/GraphicalEffects/private/libqtgraphicaleffectsprivateplugin.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6Quick.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6QmlMeta.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6QmlModels.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6OpenGL.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6ShaderTools.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6Gui.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledHarfbuzz.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledFreetype.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledLibpng.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledSpirv_Cross.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledGlslang_Glslang.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledGlslang_Spirv.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledGlslang_Osdependent.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledGlslang_Oglcompiler.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6Qml.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6Network.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6Core.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledZLIB.a C:/Qt/6.8.0/wasm_singlethread/lib/libQt6BundledPcre2.a -LC:\Develop\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten --whole-archive -lfetch -lembind-rtti --no-whole-archive -lGL-webgl2 -lal -lhtml5 -lbulkmemory -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr C:\Users\Jason\AppData\Local\Temp\tmp2bla0c70libemscripten_js_symbols.so --strip-debug --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__wasm_call_ctors --export-table -z stack-size=5242880 --initial-memory=52428800 --max-memory=4294967296 --no-entry --table-base=1 --global-base=1024' failed (returned 1) mingw32-make: *** [Makefile:49: sub-JQClock-make_first] Error 2 mingw32-make: *** Waiting for unfinished jobs.... wasm-ld: error: unable to find library -lQmlModels mingw32-make[1]: *** [Makefile:80: JQRing.js] Error 1
-
This is the code. I have tried this project in 6.5 and 6.7, and it can compile and run normally.
https://github.com/188080501/JQWeb -
That's a bug. Please submit a bug report with a reproducer here.
-
Okay, I have submitted the bug here: https://bugreports.qt.io/browse/QTBUG-127425