Qt WebAssembly compiler error
-
Hello,
I am trying to install Qt for WebAssembly for Linux system (Manjaro Qt 5.15.2) and i have installed Emscripten without any problem, my problem is with setting the compiler in QtCreator and I'm still new in Qt and Linux,
Steps completed
1- git clone https://github.com/emscripten-core/emsdk.git
2- cd emsdk
3- ./emsdk install 1.39.8
4- ./emsdk activate 1.39.8
5- source ./emsdk_env.sh
6- add ".source ~/emsdk/emsdk_env.sh" to .bashrc
7- emcc --version
emcc (Emscripten gcc/clang-like replacement) 1.39.8 (commit aa5fedfe291d05ceb4753be8af2acf0478a4a9d6)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8- Open QtCreator 4.13.3
9- Help -> About Plugins -> Device Support -> enable WebAssembly
10- Found another article here about setting Qt for WebAssembly
11- Downloading "qt-unified-linux-x64-3.2.1-2-online"
12- installing WebAssembly
13- Open Qt creator (the one installed from the online installer not from the package manger)
14- Repeat step 8.
--Tools -> Kits
--Compilers
--- No Emscripten compiler
--- Clicking Re-Detect giving me [This toolchain is invalid] Error
[Edit]
Going back to this article again i have tried compiling from terminal and I'm getting this error
-
@Noob-pilot You do not have valid Emscripten compiler configuration. Add one manually with path to the compiler and set this compiler in your Kit.
-
@jsulm Hi, thank you for replying, i did add the path manually image below
-emsdk/upstream/bin/clang++ for C++
-emsdk/upstream/bin/clang for C
Also tried (emsdk/upstream/emscripten/emcc for C and emsdk/upstream/emscripten/em++ for C++) too
but I'm getting [ABI Detection failed]
I created a new QML project (Stack project) and this is the result i get when running the prjectAnd this is the compile output
/bin/ld: /home/noob-pilot/Qt/5.15.2/wasm_32/plugins/platforms/libqwasm.a: error adding symbols: file format not recognized
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:208: asw] Error 1
10:48:25: The process "/bin/make" exited with code 2.
Error while building/deploying project asw (kit: Qt 5.15.2 WebAssembly)
When executing step "Make" -
@Noob-pilot Do a complete rebuild: delete build folder, run qmake and build
-
@jsulm here is what i did now
--getting this general message
Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang -dumpmachine" could not be started.Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang -print-search-dirs" could not be started.Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang++ -dumpmachine" could not be started.Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang++ -print-search-dirs" could not be started.Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang -dumpmachine" could not be started.Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang -print-search-dirs" could not be started.Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang++ -dumpmachine" could not be started.Compiler feature detection failure!
The command "/home/noob-pilot/emsdk/upstream/bin/clang++ -print-search-dirs" could not be started.*run the project
getting this error again (without the warrnings this time)
-
@Noob-pilot Hello,
I know it is quite old, but I have the same issue.
Did you solve it eventually?Thank you
-
I also know this is quite old, but the correct QT docs are hard to find when you approach it from the error first -> search later stance.
TL;DR You need to add your emsdk path to Options >> Devices >> Webassembly tab, before trying to configure any kind of Kit for Webassembly. This here describes it with pictures to guide you along:
https://doc-snapshots.qt.io/qtcreator-master/creator-setup-webassembly.html