QtCreator cannot find the emscripten compiler

Viewed 1342

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):

enter image description here

It cannot determine the path of compilers by itself.

In the Compilers tab I manually added a compiler as follows:

enter image description here

But I get this error in the Kits tab after that:

enter image description here

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.

enter image description here

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.

3 Answers

Make sure you run:
emsdk install
and
emsdk activate
within emsdk folder, not from a relative path.

You have to setup the emsdk inside QtCreator => Preferences => Devices => WebAssembly. Afterwards the compiler should be auto-detected by Qt Creator.

enter image description here

I had the same problem and the solution was, that python was not correctly recognized. In my case the symbolic link /usr/bin/python was not set ln -sf /usr/bin/python3 /usr/bin/python Afterwards the emsripten Toolchain is recognized automatically in QtCreator.

Related