Is it possible to build vtkGuiSupportQt in wasm?

I try to build vtk with qt in wasm, but when it comes to vtkGuiSupportQt, it generate errors like this:

D:\myLibs\VTK\vtk-v9.1.0\GUISupport\Qt\QVTKOpenGLWindow.cxx:266:43: error: use of undeclared identifier ‘GL_BACK_LEFT’
this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));
^
D:\myLibs\VTK\vtk-v9.1.0\GUISupport\Qt\QVTKOpenGLWindow.cxx:268:43: error: use of undeclared identifier ‘GL_BACK_RIGHT’
this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize));
^
D:\myLibs\VTK\vtk-v9.1.0\GUISupport\Qt\QVTKOpenGLWindow.cxx:273:43: error: use of undeclared identifier ‘GL_BACK_LEFT’
this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));

It seems that GL.h is missing, but I’m not sure how to solve it.
Does anyone have some advice?
Thank you in advance!

@jaswantp

VTK can definitely target WebAssembly with emscripten. However, we do not really test with Qt.

What does your cmake configure command look like? Also, a couple things have changed since vtk-9.1.0. Care to try the master branch?

Hi @jaswantp
Thank you for your reply, I will try master branch in the next days.

The building of master branch have the same errors, It seems QVTKOpenGLWindow need some change.

Cross-posting the issue reply here : https://gitlab.kitware.com/vtk/vtk/-/issues/19146#note_1437529