VTK9.1.0 Build failed on jetson(ubuntu18.04)
I try to compile VTK9.1.0-rc1 on a Jetson device, and the operating system is ubuntu18.04. In order to combine VTK with Qt, I turned on the Qt GUI Support options, but the compilation failed, indicating that OpenGL-related macro definitions are missing. I manually added <GL/gl.h>, after the error disappeared, "glPointParameteri was not declared in this scope of file vtkOpenGLContextDevice2D.cxx" appeared again. I still manually added the header file <GL/glext.h>, but it didn't work. I saw a related problem in the Issues column, saying that it can be solved by recompiling the Qt source code and turning on the OpenGL function. I tried to compile the Qt12.5.11 version of the source code and recompile the VTK after it was completed, but it didn’t work. In the same situation, I added -opengl desktop to my Qt configure option, because dynamic is invalid in Unix systems. How to solve this compilation problem? If you just turn off the rendering-related modules, then Qt will not be able to use VTK. This is for me It doesn't make sense, thank you.
In file included from /home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:63:0:
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h: In member function ‘void vtkOpenGLContextDevice2D::Private::SaveGLState(vtkOpenGLState*, bool)’:
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h:312:32: error: ‘GL_DRAW_BUFFER’ was not declared in this scope
ostate->vtkglGetIntegerv(GL_DRAW_BUFFER, &this->SavedDrawBuffer);
^~~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h:312:32: note: suggested alternative: ‘GL_DRAW_BUFFER0’
ostate->vtkglGetIntegerv(GL_DRAW_BUFFER, &this->SavedDrawBuffer);
^~~~~~~~~~~~~~
GL_DRAW_BUFFER0
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx: In member function ‘virtual void vtkOpenGLContextDevice2D::DrawPointSprites(vtkImageData*, float*, int, unsigned char*, int)’:
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1128:16: error: ‘GL_POINT_SPRITE’ was not declared in this scope
glEnable(GL_POINT_SPRITE);
^~~~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1128:16: note: suggested alternative: ‘GL_POINTS’
glEnable(GL_POINT_SPRITE);
^~~~~~~~~~~~~~~
GL_POINTS
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1129:34: error: ‘GL_COORD_REPLACE’ was not declared in this scope
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
^~~~~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1129:34: note: suggested alternative: ‘GL_REPLACE’
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
^~~~~~~~~~~~~~~~
GL_REPLACE
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1129:7: error: ‘glTexEnvi’ was not declared in this scope
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
^~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1131:23: error: ‘GL_POINT_SPRITE_COORD_ORIGIN’ was not declared in this scope
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1131:53: error: ‘GL_LOWER_LEFT’ was not declared in this scope
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
^~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1131:53: note: suggested alternative: ‘GL_LOW_INT’
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
^~~~~~~~~~~~~
GL_LOW_INT
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1131:5: error: ‘glPointParameteri’ was not declared in this scope
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
^~~~~~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1131:5: note: suggested alternative: ‘glProgramParameteri’
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
^~~~~~~~~~~~~~~~~
glProgramParameteri
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1137:17: error: ‘GL_POINT_SPRITE’ was not declared in this scope
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
^~~~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1137:17: note: suggested alternative: ‘GL_POINTS’
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
^~~~~~~~~~~~~~~
GL_POINTS
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1137:34: error: ‘GL_COORD_REPLACE’ was not declared in this scope
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
^~~~~~~~~~~~~~~~
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1137:34: note: suggested alternative: ‘GL_REPLACE’
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
^~~~~~~~~~~~~~~~
GL_REPLACE
/home/hypersen/vtk-v9.1.0.rc1/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:1137:7: error: ‘glTexEnvi’ was not declared in this scope
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);