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...
Forum Updated to NodeBB v4.3 + New Features

Just tried building for WS...

Scheduled Pinned Locked Moved Solved Qt for WebAssembly
8 Posts 6 Posters 1.6k 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.
  • M Offline
    M Offline
    mzimmers
    wrote on 12 Oct 2023, 22:59 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 17 Oct 2023, 12:37 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.

      M 1 Reply Last reply 17 Oct 2023, 22:28
      1
      • S Offline
        S Offline
        shanmukha
        wrote on 15 Oct 2023, 03:41 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 17 Oct 2023, 12:37 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.

          M 1 Reply Last reply 17 Oct 2023, 22:28
          1
          • A Adam C
            17 Oct 2023, 12:37

            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.

            M Offline
            M Offline
            mzimmers
            wrote on 17 Oct 2023, 22:28 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
            • M mzimmers has marked this topic as solved on 17 Oct 2023, 22:28
            • F Offline
              F Offline
              fokhagyma
              wrote on 19 Oct 2024, 23:25 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.

              G 1 Reply Last reply 11 Nov 2024, 10:32
              0
              • F fokhagyma
                19 Oct 2024, 23:25

                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.

                G Offline
                G Offline
                Gilboonet
                wrote on 11 Nov 2024, 10:32 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).

                J 1 Reply Last reply 11 Nov 2024, 12:33
                0
                • G Gilboonet
                  11 Nov 2024, 10:32

                  @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).

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 11 Nov 2024, 12:33 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

                  G 1 Reply Last reply 11 Nov 2024, 14:21
                  0
                  • J jsulm
                    11 Nov 2024, 12:33

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

                    G Offline
                    G Offline
                    Gilboonet
                    wrote on 11 Nov 2024, 14:21 last edited by Gilboonet 11 Nov 2024, 14:22
                    #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