Just tried building for WS...
-
wrote on 12 Oct 2023, 22:59 last edited by
...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...
-
wrote on 17 Oct 2023, 12:37 last edited by Adam C
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.
-
wrote on 17 Oct 2023, 12:37 last edited by Adam C
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.
wrote on 17 Oct 2023, 22:28 last edited by@Adam-C yeah, I just didn't read the instructions carefully enough -- I didn't perform these steps:
.\emsdk install 3.1.25 .\emsdk activate 3.1.25
(on Windows)
It successfully builds now -- next step is to see if it runs.
Thanks...
-
-
wrote on 19 Oct 2024, 23:25 last edited by
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.
-
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.
wrote on 11 Nov 2024, 10:32 last edited by@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).
-
@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?
-
@Gilboonet Can you explain better what problem you have? What exactly does not work? What error do you get?
wrote on 11 Nov 2024, 14:21 last edited by Gilboonet 11 Nov 2024, 14:22@jsulm My problem was that I had a Qt project from 2 years ago that compiled for WAsm and now has errors (linking errors). It was a QMake project and I converted it to CMake so that now it compiles again. Thank you.