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

WebAssemby project - bild error

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
9 Posts 7 Posters 1.3k Views 3 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
    Milosz
    wrote on last edited by
    #1

    Hi to all
    I have genetared a new WebAssembly project
    (Windows, WebAssembly Qt 6.3.0 and Emscripten Compiler 3.1.13) and at once I tried to build it.
    The error apeared like this:
    error: undefined symbol: _ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv
    (referenced by top-level compiled C/C++ code)

    Do you have any idea how to deal with it.

    Thanks in advance

    1 Reply Last reply
    1
    • Y Offline
      Y Offline
      yaheme
      wrote on last edited by
      #2

      +1

      Same error here

      (Windows, Qt 6.3.1, Emscripten Compiler 3.1.15)

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Illogica
        wrote on last edited by
        #3

        +1
        Same error here, Win10, Qt6.3.1, Emsdk 3.1.15

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Use 3.1.10 like the documentation says...

          (Z(:^

          1 Reply Last reply
          1
          • J Offline
            J Offline
            jhayar
            wrote on last edited by jhayar
            #5

            Same error here , mine this error appears when importing QtQuick.Controls in QML

            even quickcontrols2 is exists in .pro file ,

            removing QtQuickControls removes the rror

            are you using Windows ?

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Marcin22
              wrote on last edited by
              #6

              Same issue here. I am using Qt 6.4 with the following emscripten version:
              emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.14 (4343cbec72b7db283ea3bda1adc6cb1811ae9a73)
              According to the Qt docs, it is the proper version of the emscripten compiler (https://doc.qt.io/qt-6/wasm.html).

              Applying the ERROR_ON_UNDEFINED_SYMBOLS=0 flag does not change a thing.

              1 Reply Last reply
              0
              • lorn.potterL Offline
                lorn.potterL Offline
                lorn.potter
                wrote on last edited by
                #7

                Qt 6.3 uses Emscripten 3.0.0
                Qt 6.4 uses Emscripten 3.1.14

                Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                M 1 Reply Last reply
                0
                • lorn.potterL lorn.potter

                  Qt 6.3 uses Emscripten 3.0.0
                  Qt 6.4 uses Emscripten 3.1.14

                  M Offline
                  M Offline
                  Marcin22
                  wrote on last edited by
                  #8

                  @lorn-potter As stated, I use qt 6.4 and emscripten 3.1.14

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Marcin22
                    wrote on last edited by Marcin22
                    #9

                    When I removed all the code and left only a declaration of the QWebSocket type variable in the code, I got the following error. I am including <QtWebSockets/QWebSocket> and added websockets to my qmake. I added -lwebsocket.js to make arguments in the creator as well.

                    The -lwebsocket.js seems to be the problem. I tried to build a minimal project w/ WebSocket outside Qt, using the emscripten API and I received a similar error when I did not include -lwebsocket.js into the build command. Apparently, when using Qt creator the compiler is not receiving the argument, regardless of where I'll put it. I tried adding it to the .pro file in several ways as well (using: QMAKE_LFLAGS, QMAKE_CXXFLAGS, LIBS, CONFIG)

                    error: undefined symbol: _ZN10QWebSocketC1ERK7QStringN18QWebSocketProtocol7VersionEP7QObject (referenced by top-level compiled C/C++ code)
                    warning: Link with -sLLD_REPORT_UNDEFINED to get more information on undefined symbols
                    warning: To disable errors for undefined symbols use -sERROR_ON_UNDEFINED_SYMBOLS=0
                    warning: __ZN10QWebSocketC1ERK7QStringN18QWebSocketProtocol7VersionEP7QObject may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
                    error: undefined symbol: _ZN10QWebSocketD1Ev (referenced by top-level compiled C/C++ code)
                    warning: __ZN10QWebSocketD1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
                    Error: Aborting compilation due to previous errors
                    em++: error: '
                    /emsdk/node/14.18.2_64bit/bin/node /emsdk/upstream/emscripten/src/compiler.js /var/folders/qn/gzn_l03x2ds1cdh94cysrhfw0000gq/T/tmp4su37te2.json'

                    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