Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Configuring Qt for WebAssembly and Emscripten
Forum Updated to NodeBB v4.3 + New Features

Configuring Qt for WebAssembly and Emscripten

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
webassemblyqt 5.15emscriptencompiler error
3 Posts 3 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ronaldo
    wrote on last edited by ronaldo
    #1

    I am trying to configure Emscripten with Qt for WebAssembly. However, my auto-detected Emscripten Compiler is showing an error (This toolchain is invalid). I have already downloaded and installed Emscripten and sed.

    fa73c7ac-4d95-4203-9e49-6744f75781c0-image.png

    This may be because the displayed Compiler Path is set to \clang.exe for both C and C++ - is there a way to change this? What does it need to be changed to?

    8190f192-f883-4e95-b52d-072e1af5da13-image.png

    This is my WebAssembly Kit:
    e05e78e1-21a2-40ec-938b-cef2357bd800-image.png

    When I try to 'run qmake' the error returned is

    Project ERROR: Cannot run target compiler 'em++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    

    I am aware that you need to setup the environment for the terminal using emsdk_env.bat but how does it work with Qt Creator?

    All help appreciated.

    1 Reply Last reply
    1
    • SyntaXS Offline
      SyntaXS Offline
      SyntaX
      wrote on last edited by
      #2

      dunno if you managed to resolve your problem in the meantime,
      but I had a similar error (under macOS and emscripten 1.39.17):

      After downloading and installing everything, I ran emsdk_env (which should generate the ~/.emscripten file in the user folder, if I remember correctly)

      But it seems, that Qt Creator could not resolve the var for the defined emsdk_path

      emsdk_path = os.path.dirname(os.environ.get('EM_CONFIG')).replace('\\', '/')
      

      so I replaced all the placeholder with the explicit path:

      emsdk_path = '/Users/myuser/Documents/Programming/emsdk'
      

      I also added

      COMPILER_ENGINE = NODE_JS
      JS_ENGINES = [NODE_JS]
      

      at the bottom (not sure though if that was needed)

      After restarting Qt creator the compiler and toolkit for WebAssembly wer successfully recognized.

      1 Reply Last reply
      0
      • 8Observer88 Offline
        8Observer88 Offline
        8Observer8
        wrote on last edited by 8Observer8
        #3

        pro:

        wasm: INCLUDEPATH += "C:\emsdk\upstream\emscripten\cache\sysroot\include"
        

        Settings for Qt 6.6.3:

        image.png

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved