problem with build vtk9.2.6 to wasm

I follow the instructions here to build vtk9.2.6 to wasm
the building process is fine.
but when I build the Cone example, it generate link errors below.

warning: undefined symbol: glPointSize (referenced by top-level compiled C/C++ code)
warning: undefined symbol: glReadBuffer (referenced by top-level compiled C/C++ code)
warning: undefined symbol: glTexImage1D (referenced by top-level compiled C/C++ code)
warning: undefined symbol: glXGetClientString (referenced by top-level compiled C/C++ code)
warning: undefined symbol: glXGetProcAddressARB (referenced by top-level compiled C/C++ code)
warning: undefined symbol: glXQueryVersion (referenced by top-level compiled C/C++ code)

I thought it may miss libGL.a, but I found -lGL in the link commands.
Does anyone know why this happen?
btw: my emscripten version is 3.1.14

Hi @wh0395

From the last three lines, it appears that X gets included. Are you building within a docker container or outside? Can you please try to build in an isolated docker container with dockcross/web-wasm, the same steps apply. You could also try with a more recent emscripten toolchain.

Hi @jaswantp
Thanks for your reply, I was building vtk wasm on windows, and I found the solution here.
the option -DVTK_OPENGL_USE_GLES=ON is needed, and also the opengl include directories

It’s your post too, thank you again!

@wh0395 , yes, that post was before we enabled official wasm builds in VTK. It was enabled very recently at the start of this year :slight_smile:

Great, I’m looking forward to the new version. :smile: