undefined reference to `glXQueryVersion' with ParaView 5.7.0RC1 and EGL combination

Hi,

I am getting following error when I try to install ParaView 5.7.0RC1 with EGL support,

[ 95%] Building CXX object VTK/Rendering/OpenGL2/CMakeFiles/vtkProbeOpenGLVersion.dir/vtkProbeOpenGLVersion.cxx.o
[ 95%] Linking CXX executable …/…/…/bin/vtkProbeOpenGLVersion-pv5.7
…/…/…/lib64/libvtkglew-pv5.7.so.5.7: undefined reference to glXQueryVersion' ../../../lib64/libvtkglew-pv5.7.so.5.7: undefined reference toglXGetProcAddressARB’
…/…/…/lib64/libvtkglew-pv5.7.so.5.7: undefined reference to `glXGetClientString’

I could build 5.6.1 in the same environment with our any problem.

–ufuk

Hmm. Is VTK_USE_X set?

No, it is set as OFF.

Hmm. Does it work if you turn it ON? If it does, we should look into getting vtkglew to work when VTK_USE_X is disabled.

Hi Ben,

I could able to compile when i set VTK_USE_X ON. Do you think that there
is a bug in 5.7.0RC1? I think i could not use EGL with this version
because it will try to open a X window. Right? Thanks for your help.

–ufuk

I think there’s something not being passed down to the glew build to disable X symbol usage. @martink?

Nearly 4 years later…

Just got burnt by this one with the ongoing emscripten work. X gets disabled in vtkOpenGLOptions.cmake for emscripten. vtkglew does not include that script and assumes X is enabled, goes ahead to call glX funcs, ends up with undefined refs.

I suspect the order of vtk_source_directories causes trouble. VTK_USE_X is set in vtkOpenGLOptions.cmake, include by Utilities/OpenGL module. However, the Utilities directory is scanned after Thirdparty/.

Explains why one needed to add -DVTK_OPENGL_USE_GLES=ON on the command line for configure. Anyway, including vtkOpenGLOptions.cmake in Thirdparty/glew/CMakeLists.txt fixed it. Will open a mr for this.

1 Like