Link error duplicate reference for VTK and QT when building for webasm: free type
-
I am trying to build an application that was previously built by an old developer in QT and VTK, but unfortunately he did not gave further instructions so I am trying to build it again and trying to reproduce his steps.
Anyways, I have built my QT for web asm using the following configure
configure.bat -qt-host-path C:\Qt\6.5.0\mingw_64 -no-warnings-are-errors -feature-opengles3 -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -platform wasm-emscripten -prefix $PWD/qtbase
I set-up I set qmake.bat from C:\Qt\6.5.0\wasm_singlethread\bin as environment variable
I built VTK 9.2.6 using this configuration
emcmake cmake . -B C:\build-vtk-wasm -GNinja -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DVTK_ENABLE_LOGGING:BOOL=OFF -DVTK_ENABLE_WRAPPING:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_hdf5:STRING=NO -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2:STRING=DONT_WANT -DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2:STRING=DONT_WANT -DVTK_MODULE_ENABLE_VTK_RenderingCellGrid:STRING=NO -DVTK_MODULE_ENABLE_VTK_sqlite:STRING=NO -DCMAKE_INSTALL_PREFIX=C:\vtk-install
Built my application and ran
mingw32-makeMy application does build but failed on linking, apparently the freetype library in VTK is conflicting or contains the same functions with the one in QT
wasm-ld: error: duplicate symbol: FT_GlyphLoader_CreateExtra >>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o) >>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o) wasm-ld: error: duplicate symbol: ft_mem_realloc >>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o) >>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)
Anyone got an idea?
Can I disable can I disable Qt6BundledFreetype in QT? How to?
This is related to:
https://forum.qt.io/topic/150648/im-getting-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc