Trouble getting started with WebAssembly + QtWidgets (c++, Windows)
Unsolved
Qt for WebAssembly
-
I create desktop QtWidget apps, but I'm interested in putting my work on the web.
I'm not too familiar with command-line building, so I might be making an obvious mistake.
For now I'm just trying to build a bare-bones CPP and failing. Should I be using cmake instead?
C:\Git\wasm_test>C:\Git\emsdk\emsdk_env.bat Setting up EMSDK environment (suppress these messages with EMSDK_QUIET=1) Adding directories to PATH: PATH += C:\Git\emsdk PATH += C:\Git\emsdk\upstream\emscripten PATH += C:\Git\emsdk\node\14.18.2_64bit\bin Setting environment variables: PATH = C:\Git\emsdk;C:\Git\emsdk\upstream\emscripten;C:\Git\emsdk\node\14.18.2_64bit\bin; (...) EMSDK = C:/Git/emsdk EMSDK_NODE = C:\Git\emsdk\node\14.18.2_64bit\bin\node.exe EMSDK_PYTHON = C:\Git\emsdk\python\3.9.2-nuget_64bit\python.exe JAVA_HOME = C:\Git\emsdk\java\8.152_64bit Clearing existing environment variable: EMSDK_PY C:\Git\wasm_test>D:\Qt6\6.4.2\wasm_32\bin\qmake -o Makefile hello4.pro Project MESSAGE: Setting INITIAL_MEMORY to 50MB C:\Git\wasm_test>emmake make make: make em++ -c -O2 -std=gnu++1z -Wall -Wextra -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -ID:/Qt6/6.4.2/wasm_32/include -ID:/Qt6/6.4.2/wasm_32/include/QtGui -ID:/Qt6/6.4.2/wasm_32/include/QtCore -I. -I/.emscripten_ports/openssl/include -ID:/Qt6/6.4.2/wasm_32/mkspecs/wasm-emscripten -o hello4.obj hello4.cpp /cygdrive/c/Git/emsdk/upstream/emscripten/em++: line 36: exec: C:\Git\emsdk\python\3.9.2-nuget_64bit\python.exe: not found make: *** [Makefile:655: hello4.obj] Error 127 emmake: error: 'make' failed (returned 2)
The error is weird, because
python.exe
exists at that path:C:\Git\wasm_test>C:\Git\emsdk\python\3.9.2-nuget_64bit\python.exe Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
-
You need to install ninja and use that to build.
MSVC compiler and Emscripten don't mix well.