The vtkGenericOpenGLRenderWindow cannot be used in this way. According to its documentation,
vtkGenericOpenGLRenderWindow provides a skeleton for implementing
a render window using one's own OpenGL context and drawable.
This means that it does not provide an OpenGL context. You must create an OpenGL context by other means (for example, with Qt) and then vtkGenericOpenGLRenderWindow will allow VTK to use that context.
In your case, I think you should just use vtkRenderWindow. Did you already try that, and did it fail? If so, please give details about how you built your project. You might not have linked to all the necessary libraries.
I built the project using Visual Studio and all the dependencies seem to be satisfied. I think it may be likely that the problem is how VTK was built. I’m also having issues just running this example.
So I managed to run the CylinderExample from WSL using the VcXsrv as my X-server. But I still get the same same XSync error when trying to run to run from Visual Studio, but if I run the exact same executable from the terminal then it successfully renders.