Just tried building for WS...
-
...following (I believe) the directions on this page:
On build, got this error:
15:53:09: Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build C:/Users/michael.zimmers/Qt_projects/build-hello-WebAssembly_Qt_6_5_3_single_threaded-Debug --target all [1/1 1.4/sec] Linking CXX executable apphello.js FAILED: apphello.js cmd.exe /C "cd . && C:\emsdk\upstream\emscripten\em++.bat -g -s INITIAL_MEMORY=50MB -s EXPORTED_RUNTIME_METHODS=UTF16ToString,stringToUTF16,JSEvents,specialHTMLTargets -s MAX_WEBGL_VERSION=2 -s FETCH=1 -s WASM_BIGINT=1 -s MODULARIZE=1 -s EXPORT_NAME=createQtAppInstance -s DISABLE_EXCEPTION_CATCHING=1 -s ALLOW_MEMORY_GROWTH -s DEMANGLE_SUPPORT=1 --profiling-funcs -sASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js -s ERROR_ON_UNDEFINED_SYMBOLS=1 @CMakeFiles\apphello.rsp -o apphello.js && cd ." wasm-ld: error: C:/Qt/6.5.3/wasm_singlethread/lib/libQt6Core.a(qsettings_wasm.cpp.o): undefined symbol: _emval_call_void_method
(the last line repeats several times).
I didn't make any changes to the build configuration, other than disabling debug for QML.
Does anyone have an idea what I'm doing wrong?
Thanks...
-
are you using the correct emscripten version?
Qt 6.5.3 should use emscripten 3.1.25.
I'm porting to Qt 6.6, and my app crashes with the recommended emscripten 3.1.37 version. I'm getting the same error as you if I try to compile with emscripten 3.1.47. however, it seems to work with emscripten 3.1.25 and qt 6.6.
-
are you using the correct emscripten version?
Qt 6.5.3 should use emscripten 3.1.25.
I'm porting to Qt 6.6, and my app crashes with the recommended emscripten 3.1.37 version. I'm getting the same error as you if I try to compile with emscripten 3.1.47. however, it seems to work with emscripten 3.1.25 and qt 6.6.
-
M mzimmers has marked this topic as solved on
-
Note for future readers: I was very angry that why I get linking error when the correct version of Emscripten is installed and configured. Then I discovered that when I start a new WebAssembly application in QtCreator, in the CMakeLists.txt file the add_executable word must be replaced with qt_add_executable for linking to work.
-
@fokhagyma Hello, I'm having trouble building an old project with an uptodate Qt Creator 6.8. This project uses a .pro file (qmake), so I wasn't able to see what it uses for linking, but it could be a command that need to be replace like the one you suggest (and that my new project (cmake) also uses).
-
@Gilboonet Can you explain better what problem you have? What exactly does not work? What error do you get?