Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

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
    10.png
    13- Open Qt creator (the one installed from the online installer not from the package manger)
    14- Repeat step 8.
    --Tools -> Kits
    1.png

    2.png

    --Qt Versions
    3.png
    4.png
    5.png
    6.png

    --Compilers
    --- No Emscripten compiler
    --- Clicking Re-Detect giving me [This toolchain is invalid] Error
    7.png

    [Edit]
    Going back to this article again i have tried compiling from terminal and I'm getting this error
    13.png


  • Lifetime Qt Champion

    @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
    1.png
    -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
    2.png
    but I'm getting [ABI Detection failed]
    3.png
    4.png
    I created a new QML project (Stack project) and this is the result i get when running the prject

    5.png

    And 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"


  • Lifetime Qt Champion

    @Noob-pilot Do a complete rebuild: delete build folder, run qmake and build



  • @jsulm here is what i did now

    • Right click on the project and clean
    • Rebuild
    • Remove the build folder
    • run qmake
      10.png

    --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)
    11.png


Log in to reply