Qt 6.11 is out! See what's new in the release
blog
Using qmake subprojects with WebAssembly
-
Hi,
I am trying to compile an existing program to Wasm. The code consists of a main executable and some "plugins" which are built using the "subdirs" template.
For "normal" targets (Linux, Windows) I include the "plugins" in the .pro file of the project.Now for Wasm, the compiler tells me:
error: undefined symbol: _Z27qt_static_plugin_FirePluginv (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: __Z27qt_static_plugin_FirePluginv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _Z27qt_static_plugin_WindPluginv (referenced by top-level compiled C/C++ code) warning: __Z27qt_static_plugin_WindPluginv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _Z33qt_static_plugin_BarkBeetlePluginv (referenced by top-level compiled C/C++ code) warning: __Z33qt_static_plugin_BarkBeetlePluginv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library Error: Aborting compilation due to previous errorsIs there a way to include these modules also for WASM?
This is how it looks like for windows in the .pro file:
win32-msvc*:{ #release msvc PRE_TARGETDEPS += ../plugins/iland_fire.lib PRE_TARGETDEPS += ../plugins/iland_wind.lib PRE_TARGETDEPS += ../plugins/iland_barkbeetle.lib LIBS += -L../plugins -liland_fire -liland_wind -liland_barkbeetle } }I am using Qt6.5.2, emscripten 3.1.25, Ubuntu 20.4.
Any help is appreciated!