# Odd error building Paraview 5.11.1

**URL:** https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724
**Category:** ParaView Support
**Created:** [May 27, 2025, 10:43am UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724 "2025-05-27T10:43:43Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![lcbur](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lcbur/32/16514_2.png) [@lcbur](https://discourse.paraview.org/u/lcbur)
#### Post date: [May 27, 2025, 10:43am UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/1 "2025-05-27T10:43:43Z")

</div>

Trying to build paraview on Rocky 9.5, with OSMesa installed we get the following odd errors:

```auto
In file included from /home/paraview/src/VTK/ThirdParty/glew/vtkglew/src/glew.c(41):                                                               
/usr/include/GL/osmesa.h(125): error: expected a ";"                                                     
  OSMesaCreateContext( GLenum format, OSMesaContext sharelist );                                         
  ^                                                                                                                                                                                                     
In file included from /home/paraview/src/VTK/ThirdParty/glew/vtkglew/src/glew.c(41):                                                               
/usr/include/GL/osmesa.h(138): error: expected a ";"                                                     
  OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,

In file included from /home/paraview/src/VTK/ThirdParty/glew/vtkglew/src/glew.c(41):                                                               
/usr/include/GL/osmesa.h(176): error: declaration is incompatible with "OSMesaContext APIENTRY" (declared at line 124)                                                                                           
  GLAPI void APIENTRY                                                                                    
             ^    

```

Any idea why is this happening?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 27, 2025, 11:46am UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/2 "2025-05-27T11:46:24Z")

</div>

> [@lcbur](#):
>
> OSMesa

Same error as this ?

> **[Inconsistent building error "error: expected a ";" "](https://discourse.vtk.org/t/inconsistent-building-error-error-expected-a/15665)**
>
> When building VTK on Rocky 9.5 and Intel compilers we get the following errors: In file included from /home/myaux/ParaView-v5.11.1/VTK/ThirdParty/glew/vtkglew/src/glew.c(41): ...

---

<div class="post-metadata">

### Author: ![lcbur](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lcbur/32/16514_2.png) [@lcbur](https://discourse.paraview.org/u/lcbur)
#### Post date: [May 27, 2025, 12:50pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/3 "2025-05-27T12:50:32Z")

</div>

Same error, no solution so far

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 27, 2025, 12:55pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/4 "2025-05-27T12:55:17Z")

</div>

Its also not related to VTK or ParaView ?

---

<div class="post-metadata">

### Author: ![lcbur](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lcbur/32/16514_2.png) [@lcbur](https://discourse.paraview.org/u/lcbur)
#### Post date: [May 27, 2025, 12:57pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/5 "2025-05-27T12:57:06Z")

</div>

It happens compiling VTK/ThirdParty/glew/vtkglew/src/glew.c as part of the Paraview building process.

---

<div class="post-metadata">

### Author: ![lcbur](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lcbur/32/16514_2.png) [@lcbur](https://discourse.paraview.org/u/lcbur)
#### Post date: [May 27, 2025, 1:00pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/6 "2025-05-27T13:00:59Z")

</div>

The error goes away when eliminating `-DGLEW_OSMESA` → `icc -diag-disable=10441,266 -DGLEW_NO_GLU # -DGLEW_OSMESA` from the compilation command line.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dgobbi/32/11302_2.png) [@dgobbi](https://discourse.paraview.org/u/dgobbi)
#### Post date: [May 27, 2025, 1:14pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/7 "2025-05-27T13:14:20Z")

</div>

`APIENTRY` is windows-specific, so my guess is that an `#if`/`#ifdef` in one of the GL headers is not correctly identifying the icc compiler and is incorrectly falling back on windows-specific settings.

---

<div class="post-metadata">

### Author: ![lcbur](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lcbur/32/16514_2.png) [@lcbur](https://discourse.paraview.org/u/lcbur)
#### Post date: [May 27, 2025, 1:22pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/8 "2025-05-27T13:22:02Z")

</div>

that would make sense. Any ideas how to fix this?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dgobbi/32/11302_2.png) [@dgobbi](https://discourse.paraview.org/u/dgobbi)
#### Post date: [May 27, 2025, 2:46pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/9 "2025-05-27T14:46:53Z")

</div>

> [@lcbur](#):
>
> Any ideas how to fix this?

Easiest fix would be to use gcc instead of icc.

I already suggested a fix on the VTK discourse thread that is linked above. Try giving `GLAPIENTRY` an empty definition. For good measure, you can try giving `APIENTRY` an empty definition, too.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dgobbi/32/11302_2.png) [@dgobbi](https://discourse.paraview.org/u/dgobbi)
#### Post date: [May 27, 2025, 3:56pm UTC](https://discourse.paraview.org/t/odd-error-building-paraview-5-11-1/16724/10 "2025-05-27T15:56:35Z")

</div>

The following VTK merge request looks related (see the end of the discussion for links to the suggested APIENTRY work-arounds for osmesa):  
[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/10980](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10980)
