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

**URL:** https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196
**Category:** ParaView Support
**Tags:** opengl
**Created:** [July 11, 2019, 4:58am UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196 "2019-07-11T04:58:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![uturuncoglu](https://discourse.paraview.org/user_avatar/discourse.paraview.org/uturuncoglu/32/1530_2.png) [@uturuncoglu](https://discourse.paraview.org/u/uturuncoglu)
#### Post date: [July 11, 2019, 4:58am UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196/1 "2019-07-11T04:58:17Z")

</div>

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 to`glXGetProcAddressARB’  
…/…/…/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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [July 11, 2019, 12:08pm UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196/2 "2019-07-11T12:08:05Z")

</div>

Hmm. Is `VTK_USE_X` set?

---

<div class="post-metadata">

### Author: ![uturuncoglu](https://discourse.paraview.org/user_avatar/discourse.paraview.org/uturuncoglu/32/1530_2.png) [@uturuncoglu](https://discourse.paraview.org/u/uturuncoglu)
#### Post date: [July 11, 2019, 3:53pm UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196/3 "2019-07-11T15:53:16Z")

</div>

No, it is set as OFF.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [July 11, 2019, 7:42pm UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196/4 "2019-07-11T19:42:41Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![uturuncoglu](https://discourse.paraview.org/user_avatar/discourse.paraview.org/uturuncoglu/32/1530_2.png) [@uturuncoglu](https://discourse.paraview.org/u/uturuncoglu)
#### Post date: [July 12, 2019, 4:00pm UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196/5 "2019-07-12T16:00:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [July 15, 2019, 12:31pm UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196/6 "2019-07-15T12:31:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jaswantp/32/11456_2.png) [@jaswantp](https://discourse.paraview.org/u/jaswantp)
#### Post date: [January 22, 2023, 7:09pm UTC](https://discourse.paraview.org/t/undefined-reference-to-glxqueryversion-with-paraview-5-7-0rc1-and-egl-combination/2196/7 "2023-01-22T19:09:58Z")

</div>

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.
