WebAssemby project - bild error
-
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
-
Use 3.1.10 like the documentation says...
-
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.
-
Qt 6.3 uses Emscripten 3.0.0
Qt 6.4 uses Emscripten 3.1.14 -
Qt 6.3 uses Emscripten 3.0.0
Qt 6.4 uses Emscripten 3.1.14 -
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'