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. Just tried building for WS...
Servers for Qt installer are currently down

Just tried building for WS...

Scheduled Pinned Locked Moved Solved Qt for WebAssembly
8 Posts 6 Posters 1.4k Views 2 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    ...following (I believe) the directions on this page:

    On build, got this error:

    15:53:09: Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build C:/Users/michael.zimmers/Qt_projects/build-hello-WebAssembly_Qt_6_5_3_single_threaded-Debug --target all
    [1/1 1.4/sec] Linking CXX executable apphello.js
    FAILED: apphello.js 
    cmd.exe /C "cd . && C:\emsdk\upstream\emscripten\em++.bat -g -s INITIAL_MEMORY=50MB -s EXPORTED_RUNTIME_METHODS=UTF16ToString,stringToUTF16,JSEvents,specialHTMLTargets -s MAX_WEBGL_VERSION=2 -s FETCH=1 -s WASM_BIGINT=1 -s MODULARIZE=1 -s EXPORT_NAME=createQtAppInstance -s DISABLE_EXCEPTION_CATCHING=1 -s ALLOW_MEMORY_GROWTH -s DEMANGLE_SUPPORT=1 --profiling-funcs -sASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js -s ERROR_ON_UNDEFINED_SYMBOLS=1 @CMakeFiles\apphello.rsp -o apphello.js  && cd ."
    wasm-ld: error: C:/Qt/6.5.3/wasm_singlethread/lib/libQt6Core.a(qsettings_wasm.cpp.o): undefined symbol: _emval_call_void_method
    

    (the last line repeats several times).

    I didn't make any changes to the build configuration, other than disabling debug for QML.

    Does anyone have an idea what I'm doing wrong?

    Thanks...

    1 Reply Last reply
    1
    • A Offline
      A Offline
      Adam C
      wrote on last edited by Adam C
      #3

      are you using the correct emscripten version?

      Qt 6.5.3 should use emscripten 3.1.25.

      I'm porting to Qt 6.6, and my app crashes with the recommended emscripten 3.1.37 version. I'm getting the same error as you if I try to compile with emscripten 3.1.47. however, it seems to work with emscripten 3.1.25 and qt 6.6.

      mzimmersM 1 Reply Last reply
      1
      • S Offline
        S Offline
        shanmukha
        wrote on last edited by
        #2

        @mzimmers I am also facing the same issue

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Adam C
          wrote on last edited by Adam C
          #3

          are you using the correct emscripten version?

          Qt 6.5.3 should use emscripten 3.1.25.

          I'm porting to Qt 6.6, and my app crashes with the recommended emscripten 3.1.37 version. I'm getting the same error as you if I try to compile with emscripten 3.1.47. however, it seems to work with emscripten 3.1.25 and qt 6.6.

          mzimmersM 1 Reply Last reply
          1
          • A Adam C

            are you using the correct emscripten version?

            Qt 6.5.3 should use emscripten 3.1.25.

            I'm porting to Qt 6.6, and my app crashes with the recommended emscripten 3.1.37 version. I'm getting the same error as you if I try to compile with emscripten 3.1.47. however, it seems to work with emscripten 3.1.25 and qt 6.6.

            mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by
            #4

            @Adam-C yeah, I just didn't read the instructions carefully enough -- I didn't perform these steps:

            .\emsdk install 3.1.25
            .\emsdk activate 3.1.25
            

            (on Windows)

            It successfully builds now -- next step is to see if it runs.

            Thanks...

            1 Reply Last reply
            0
            • mzimmersM mzimmers has marked this topic as solved on
            • F Offline
              F Offline
              fokhagyma
              wrote on last edited by
              #5

              Note for future readers: I was very angry that why I get linking error when the correct version of Emscripten is installed and configured. Then I discovered that when I start a new WebAssembly application in QtCreator, in the CMakeLists.txt file the add_executable word must be replaced with qt_add_executable for linking to work.

              GilboonetG 1 Reply Last reply
              0
              • F fokhagyma

                Note for future readers: I was very angry that why I get linking error when the correct version of Emscripten is installed and configured. Then I discovered that when I start a new WebAssembly application in QtCreator, in the CMakeLists.txt file the add_executable word must be replaced with qt_add_executable for linking to work.

                GilboonetG Offline
                GilboonetG Offline
                Gilboonet
                wrote on last edited by
                #6

                @fokhagyma Hello, I'm having trouble building an old project with an uptodate Qt Creator 6.8. This project uses a .pro file (qmake), so I wasn't able to see what it uses for linking, but it could be a command that need to be replace like the one you suggest (and that my new project (cmake) also uses).

                jsulmJ 1 Reply Last reply
                0
                • GilboonetG Gilboonet

                  @fokhagyma Hello, I'm having trouble building an old project with an uptodate Qt Creator 6.8. This project uses a .pro file (qmake), so I wasn't able to see what it uses for linking, but it could be a command that need to be replace like the one you suggest (and that my new project (cmake) also uses).

                  jsulmJ Online
                  jsulmJ Online
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  @Gilboonet Can you explain better what problem you have? What exactly does not work? What error do you get?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  GilboonetG 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Gilboonet Can you explain better what problem you have? What exactly does not work? What error do you get?

                    GilboonetG Offline
                    GilboonetG Offline
                    Gilboonet
                    wrote on last edited by Gilboonet
                    #8

                    @jsulm My problem was that I had a Qt project from 2 years ago that compiled for WAsm and now has errors (linking errors). It was a QMake project and I converted it to CMake so that now it compiles again. Thank you.

                    1 Reply Last reply
                    0

                    • Login

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