Important: Please read the Qt Code of Conduct -

Problem to run QT-Webassembly Examples

  • Hi there, i would like to try qt webassembly but i didn't get it to work.
    I made following steps:

    1. Emscripten:
    sudo apt-get install python2.7
    sudo apt-get install nodejs
    sudo apt-get install cmake
    sudo apt-get install default-jre

    git clone
    cd emsdk
    git pull
    ./emsdk install latest
    ./emsdk activate latest
    source ./

    Was already installed => open MaintenanceTool
    Installed QT5.13.0-rc2 (incl. sources)
    Opend Qt => Kits => Qt 5.13.0 WebAssembly (already added but without compiler)
    Added Custom Compiler to ../emscripten/emsdk/fastcomp/emscripten/emcc (and em++)
    Added Custom Path to Make for Compiler /usr/bin/make
    Now i checked the 5.13.0 examples => took dashboard => press compile

    => ERROR
    Fatal: error in validating output
    shared:ERROR: '/home/***/emscripten_5.13/emsdk/fastcomp/bin/asm2wasm dashboard.temp.asm.js --total-memory=16777216 --trap-mode=clamp -O3 --mem-init=dashboard.js.mem --mem-base=1024 --wasm-only -o dashboard.wasm --mvp-features' failed (1)

    Then I found this link:
    I opend a new Terminal navigated to SOURCE of 5.13.0
    Executed: ./configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase
    AND: make module-qtbase module-qtdeclarative (and quickcontrols2)

    After all i tried to Build and run the test application without qtcreator

    Same error... Is there anyone who got the same issue ?

  • @davidMus

    Can you try with emscripten sdk-1.38.27-64bit?

    emsdk install sdk-1.38.27-64bit
    emsdk activate sdk-1.38.27-64bit

  • Hello, I have a same probleme, i have install sdk-1.38.27-64bit,
    but when i try to build module i ve this error

    qwasmopenglcontext.cpp:134:27: error: no matching function for call to 'emscripten_is_webgl_context_lost'
        return !m_context || !emscripten_is_webgl_context_lost(m_context);
    /home/vnc/emsdk/emscripten/1.38.16/system/include/emscripten/html5.h:457:16: note: candidate function not viable: no known conversion from
          'const EMSCRIPTEN_WEBGL_CONTEXT_HANDLE' (aka 'const int') to 'const char *' for 1st argument
    extern EM_BOOL emscripten_is_webgl_context_lost(const char *target);
    1 error generated.
    ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
    Makefile:4853 : la recette pour la cible « .obj/qwasmopenglcontext.o » a échouée
    make[5]: *** [.obj/qwasmopenglcontext.o] Erreur 1
    make[5] : on quitte le répertoire « /home/vnc/1C/5.13.0/Src/qtbase/src/plugins/platforms/wasm »
    Makefile:124 : la recette pour la cible « sub-wasm-make_first » a échouée
    make[4]: *** [sub-wasm-make_first] Erreur 2
    make[4] : on quitte le répertoire « /home/vnc/1C/5.13.0/Src/qtbase/src/plugins/platforms »
    Makefile:51 : la recette pour la cible « sub-platforms-make_first » a échouée
    make[3]: *** [sub-platforms-make_first] Erreur 2
    make[3] : on quitte le répertoire « /home/vnc/1C/5.13.0/Src/qtbase/src/plugins »
    Makefile:670 : la recette pour la cible « sub-plugins-make_first » a échouée
    make[2]: *** [sub-plugins-make_first] Erreur 2
    make[2] : on quitte le répertoire « /home/vnc/1C/5.13.0/Src/qtbase/src »
    Makefile:50 : la recette pour la cible « sub-src-make_first » a échouée
    make[1]: *** [sub-src-make_first] Erreur 2
    make[1] : on quitte le répertoire « /home/vnc/1C/5.13.0/Src/qtbase »
    Makefile:82 : la recette pour la cible « module-qtbase » a échouée
    make: *** [module-qtbase] Erreur 2

  • @MeSakone said in Problem to run QT-Webassembly Examples:


    Looks like you are still using 1.38.16

  • @lorn.potter said in Problem to run QT-Webassembly Examples:


    Its work thanks, but i have new problem,
    after compiling i obtain this error in a browser

    Qt for WebAssembly: gui_opengl
    Application exit (abort(-1). Build with -s ASSERTIONS=1 for more info.)