I followed this guide and installed emscripten using emsdk and activated it.Then I configured my $PATH
as instructed by the emsdk itself and also sourced emsdk-master/emsdk_env.sh
.Now I can access both emcc
and em++
in the terminal.The file ~/.emscripten
is also present(this is the file that QtCreator will fetch to find the path of compilers for WASM).
The WebAssembly
kit for Qt also has been installed by the Qt Maintenance Tool
.
Now in the Kit configuration in the QtCreator I get this(QtCreator is opened via terminal after sourcing emsdk_env.sh
):
It cannot determine the path of compilers by itself.
In the Compilers tab I manually added a compiler as follows:
But I get this error in the Kits tab after that:
What does that mean? What did I skip? Does anybody ever have the experience of doing this?
Also changing the compiler from em++
to wasm-32-wasi-clang++
or clang++
doesn't change anything.
By the way if I use that kit I get:
Error while parsing file whatever.pro. Giving up.
Project ERROR: Cannot run target compiler 'em++'. Output:
===================
===================
Maybe you forgot to setup the environment?
And please don't tell me that this question is the duplicate of this because it isn't(mine has more details) and there's no useful answer for that after 9 months at this time.
Any help is much appreciated.
qmake
for my project and got the warning about version incompatibility between the emsdk which was used by Qt 5.14(1.38.27) and the emsdk currently installed(2.0.0 i,e latest).So I deleted the emsdk entirely and began from scratch,this time by installing 1.38.27 and got this.Not sure what's causing that.How did you manage to build a project successfully? – Gaming~/Qt/wasm_32/bin/qmake
andmake
. It created web files insdi
folder. I tested it with~/emsdk/upstream/emscripten/emrun --browser=firefox sdi/sdi.html
which actually runs the text editor in the browser :) I created a gist with detailed steps here: gist.github.com/foolo/a728e971bdd79b37fff04ca8b65b847c – MadyQt/5.14.2/wasm_32/include/QtCore/qcompilerdetection.h:591:6: error: Qt requires a C++11 compiler and yours does not seem to be that
besides lots of other strange errors likeerror: unknown type name 'constexpr'
for that example project.After addingCONFIG+=c++11
that error turned intoFailed to run llvm optimizations:
like this.Needless to say I sourcedemsdk_env.sh
beforehand.Any idea? Should I upgrade my Qt or start from scratch? – Gaming