System cannot find specified file when building Web Assembly project in Qt
-
I'd like to use my QT application on the web but I'm running into this error when building it. Both the qtloader.js and WebAssembly_Qt_6_8_1_single_threaded-Debug folder are located in my system and match the path specified in the error message below, so I'm not sure why the error message says these files can't be found. What could be the issue here and how could it be fixed?
Windows 11
QT Web Assembly 6.8.1
emsdk 4.0.1
Error: process_begin: CreateProcess(NULL, cp -f /C/Qt/6.8.1/wasm_singlethread/plugins/platforms/qtloader.js /C/EFMM/a8-edu-app-atlantic-spigot-main/EscapeFromMorseMansion/build/WebAssembly_Qt_6_8_1_single_threaded-Debug, ...) failed. make (e=2): The system cannot find the file specified. mingw32-make: *** [Makefile:1085: appjs] Error 2 mingw32-make: *** Waiting for unfinished jobs.... 13:22:28: The process "C:\Qt\Tools\mingw1310_64\bin\mingw32-make.exe" exited with code 2. 13:22:28: Error while building/deploying project EscapeFromMorseMansion (kit: WebAssembly Qt 6.8.1 (single-threaded)) 13:22:28: When executing step "Make" --- Full Compile Output: 13:22:28: Running steps for project EscapeFromMorseMansion... 13:22:28: Configuration unchanged, skipping qmake step. 13:22:28: Starting: "C:\Qt\Tools\mingw1310_64\bin\mingw32-make.exe" -j16 sed -e s/@APPNAME@/EscapeFromMorseMansion/g -e s/@APPEXPORTNAME@/EscapeFromMorseMansion_entry/g -e s/@PRELOAD@//g C:/Qt/6.8.1/wasm_singlethread/plugins/platforms/wasm_shell.html > C:/EFMM/a8-edu-app-atlantic-spigot-main/EscapeFromMorseMansion/build/WebAssembly_Qt_6_8_1_single_threaded-Debug/EscapeFromMorseMansion.html cp -f /C/Qt/6.8.1/wasm_singlethread/plugins/platforms/qtloader.js /C/EFMM/a8-edu-app-atlantic-spigot-main/EscapeFromMorseMansion/build/WebAssembly_Qt_6_8_1_single_threaded-Debug process_begin: CreateProcess(NULL, cp -f /C/Qt/6.8.1/wasm_singlethread/plugins/platforms/qtloader.js /C/EFMM/a8-edu-app-atlantic-spigot-main/EscapeFromMorseMansion/build/WebAssembly_Qt_6_8_1_single_threaded-Debug, ...) failed. make (e=2): The system cannot find the file specified. mingw32-make: *** [Makefile:1085: appjs] Error 2 mingw32-make: *** Waiting for unfinished jobs.... 13:22:28: The process "C:\Qt\Tools\mingw1310_64\bin\mingw32-make.exe" exited with code 2. 13:22:28: Error while building/deploying project EscapeFromMorseMansion (kit: WebAssembly Qt 6.8.1 (single-threaded)) 13:22:28: When executing step "Make" 13:22:28: Elapsed time: 00:00.
-
@Gilboonet MingW64 is set when running the app on desktop, however, it appears it defaulted to mingw32 for my wasm build, as shown in the set location for make under "Build Steps" in the Projects panel:
Make: mingw32-make.exe -j16 in C:\EFMM\a8-edu-app-atlantic-spigot-main\EscapeFromMorseMansion\build\WebAssembly_Qt_6_8_1_single_threaded-Debug
-
@Ledge You can take a look at your kit configuration and see if it is as the doc states. There are those notes :
On Windows, make sure you have Mingw-w64 in your PATH and configure with the following: configure -qt-host-path C:\Path\to\Qt -no-warnings-are-errors -platform wasm-emscripten -prefix %CD%\qtbase
Note: When using vanilla CMake (as opposed to qt-cmake on Linux or qt-cmake.bat on Windows) remember to specify a toolchain file with "-DCMAKE_TOOLCHAIN_FILE", as for any other cross-platform build. For details see here: Getting started with CMake.
-
@Gilboonet I followed those steps you mentioned, requiring me to build the app on the command line and scrap what I was doing in the GUI. Now this command below to build from the command line has led to me to this error, which makes me believe I need to build from source since my qt maintenance tool already says I have multimedia downloaded. Any idea of how to resolve this error or am I following the wrong path? Do I need to change variable values to set QT6 to be found? Thank you for your time.
Command:
/c/Qt/6.8.1/wasm_singlethread/bin/qt-cmake.bat . -DQT_CHAINLOAD_TOOLCHAIN_FILE= /c/Qt/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
Error:
CMake Error at CMakeLists.txt:212 (find_package):
Found package configuration file:C:/Qt/6.8.1/wasm_singlethread/lib/cmake/Qt6/Qt6Config.cmake
but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
FOUND. Reason given by package:Failed to find required Qt component "Multimedia".
Expected Config file at
"C:/Qt/6.8.1/wasm_singlethread/lib/cmake/Qt6Multimedia/Qt6MultimediaConfig.cmake"
exists -
@Gilboonet multimedia is not officially supported, but it is available for WebAssembly.
-
@lorn-potter Thank you, I think the OP needs help from someone who already built a Wasm project with Multimedia as he didn't manage to have his project built, on the pinned discussion almost all links are dead or out of date which doesn't help much.