Where to get the source for the examples?
-
To test that I have stuff setup properly, I would like to build and run a known good example. Qt Creator has a list of examples. But, I don't see a WebAssembly one. I see examples at https://www.qt.io/qt-examples-for-webassembly. But, I don't see any link to the source.
-
Most of the Qt examples will just work in WebAssembly. My go-to is textedit.
-
Thank you! I'm not sure why I didn't realize that. I just opened the text editor example. I can build and run it on desktop linux. But, my attempt to build it for web assembly suffers the same fate as my personal project. It dies with unresolved externals to std library exception related functions.
https://forum.qt.io/topic/136843/need-help-resolving-undefined-symbols-at-compile-time
I've been digging since posting that thread above. I can build and run c++ test apps with the emsdk and load them in a browser without any issue. I did have to add a flag to the emcc command line to enable exceptions. But, I later went into the emsdk's settings.js and changed DISABLE_EXCEPTION_CATCHING to false. Now I can build with emcc and run in the browser without specifying the option on the command line. Unfortunately, none of this has helped me when building within Qt Creator. I still get the same unresolved functions. The odd part is that, despite me modifying settings.js, I still see that the emcc command that Qt is executing has DISABLE_EXCEPTION_CATCHING=1. I don't see where this is being set in the project or kit settings. I've tried adding "-s DISABLE_EXCEPTION_CATCHING=0" in my CMakeLists.txt via add_compile_options() and add_link_options(). It still doesn't change it.
Does anyone know if that is what is causing the errors?
Does anyone know how I tell Qt to stop setting DISABLE_EXCEPTION_CATCHING to 1?
-
DISABLE_EXCEPTION_CATCHING is ON by default for both Emscripten and Qt. If you reconfigure Qt with feature-exceptions, it will be turned off.
It is being set in the file named QtWasmHelpers.cmake in <qt_install_dir>/lib/cmake/Qt6/
-
@lorn-potter Are you saying I need to reconfigure and rebuild Qt? I did not build Qt initially. I just got it from the Linux install along with Qt Creator.