# VTK + QT in emscripten webassembly: opengl ERROR: unknown type name 'PFNGLPUSHDEBUGGROUPPROC'; did you mean 'PFNGLPUSHDEBUGGROUPKHRPROC'

**URL:** https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447
**Category:** Support
**Created:** [October 9, 2023, 8:17am UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447 "2023-10-09T08:17:30Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![cebugdev](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cebugdev/32/7803_2.png) [@cebugdev](https://discourse.vtk.org/u/cebugdev)
#### Post date: [October 9, 2023, 8:17am UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/1 "2023-10-09T08:17:30Z")

</div>

Our previous developer left but he only gave a little information on how he built the project in QT, but we saw that it was built succesfuly as we have seen it runing as a web page (our desktop QT that is).

here is what I did:

1. I downloaded QT as an installer

2. After download, I ran the Maintenance tool, Went to add or remove components.  
I Installed QT 6.5.0 and the platflorms  
MinGW 11.2.0 64 bit  
WebAssemby (single-threaded)  
WebAssembly (multi-threaded)  
I also downloaded under developer tools  
MingW 11.2.0 64 bit  
CMake 3.24.2

3. I also downloaded (apart from QT)  
ninja 1.11  
Emscripted 3.1.25  
VTK 9.2.6

4. So I went ahead and follow instructions based from here [Qt for WebAssembly | Qt 6.5](https://doc.qt.io/qt-6/wasm.html)  
I ran the configure with emscripten like the one bellow,

```auto
./emsdk install 3.1.25
   
 ./emsdk activate 3.1.25
   
 configure.bat -qt-host-path C:\Qt\6.5.0\mingw_64 -no-warnings-are-errors -feature-opengles3 -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -platform wasm-emscripten -prefix $PWD/qtbase

cmake –build .

```

All of the above is executed inside the source folder C:\Qt\6.5.0\Src  
And I specify mingw\_64 as the host-path as it is the ONLY one that compiles properly.

1. Then I downloaded VTK and build like this

Everything builts ok without error. So I went to our project and started the build

```auto
emsdk activate 3.1.25
emsdk_env.bat
qmake.bat OurProject.pro
mingw32-make

```

qmake.bat is from C:\Qt\6.5.0\wasm\_singlethread\bin  
while mingw32-make is from C:\Qt\Tools\mingw1120\_64\bin  
Then I got these errors

```auto
In file included from Ui\VTKWidgets\MyQVTKOpenGLWindow.cpp:46:
In file included from ..\..\dependencies\VTK-9.2.6\include\vtk-9.2\vtk_glew.h:47:
..\..\dependencies\VTK-9.2.6\include\vtk-9.2\vtkglew/include/GL/glew.h:24591:17: error: unknown type name
      'PFNGLPOPDEBUGGROUPPROC'; did you mean 'PFNGLPOPDEBUGGROUPKHRPROC'?
GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup;
                ^ ~~~~~~~~~~~~~~~~~~~~~
                PFNGLPOPDEBUGGROUPKHRPROC
C:\Qt\6.5.0\wasm_singlethread\include\QtGui/qopengles2ext.h:155:28: note: 'PFNGLPOPDEBUGGROUPKHRPROC' declared here
typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void);

```

Im not sure what is happening here? I went to the file and PFNGLPUSHDEBUGGROUPPROC is indeed defined properly in vtk-9.2\vtkglew/include/GL/glew.h  
maybe there is a conflict between OpenGL versions?  
Maybe i misconfigured VTK for opengl? I am not sure what is happening here now.

Ive been stuck wth this for over 2 weeks, please help

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [October 9, 2023, 12:32pm UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/2 "2023-10-09T12:32:20Z")

</div>

Hello @cebugdev

What is the value of `VTK_OPENGL_USE_GLES` in your CMakeCache.txt?

---

<div class="post-metadata">

### Author: ![cebugdev](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cebugdev/32/7803_2.png) [@cebugdev](https://discourse.vtk.org/u/cebugdev)
#### Post date: [October 9, 2023, 3:06pm UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/3 "2023-10-09T15:06:43Z")

</div>

> [@jaswantp](#):
>
> VTK\_OPENGL\_USE\_GLES

it is set to off in VTK CMakeCache.txt

//Use the OpenGL ES API  
VTK\_OPENGL\_USE\_GLES:BOOL=OFF

Should it be ON or Off is the correct behaviour for webasm?

This is my cmake for VTK that I used

> emcmake cmake . -B C:\build-vtk-wasm -GNinja -DBUILD\_SHARED\_LIBS:BOOL=OFF -DCMAKE\_BUILD\_TYPE:STRING=Release -DVTK\_ENABLE\_LOGGING:BOOL=OFF -DVTK\_ENABLE\_WRAPPING:BOOL=OFF -DVTK\_MODULE\_ENABLE\_VTK\_hdf5:STRING=NO -DVTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2:STRING=DONT\_WANT -DVTK\_MODULE\_ENABLE\_VTK\_RenderingLICOpenGL2:STRING=DONT\_WANT -DVTK\_MODULE\_ENABLE\_VTK\_RenderingCellGrid:STRING=NO -DVTK\_MODULE\_ENABLE\_VTK\_sqlite:STRING=NO -DCMAKE\_INSTALL\_PREFIX=C:\vtk-install

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [October 9, 2023, 3:49pm UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/4 "2023-10-09T15:49:43Z")

</div>

It should be on. Just add `-DVTK_OPENGL_USE_GLES=ON` to your cmake configure arguments.

---

<div class="post-metadata">

### Author: ![cebugdev](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cebugdev/32/7803_2.png) [@cebugdev](https://discourse.vtk.org/u/cebugdev)
#### Post date: [October 10, 2023, 8:42am UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/5 "2023-10-10T08:42:46Z")

</div>

i think it worked, thank you, i now reach the final stages of the build which is linking.

but I am having problem, seems like freetype for VTK and QT had a clash

```auto

wasm-ld: error: duplicate symbol: ft_mem_realloc
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)

wasm-ld: error: duplicate symbol: FT_GlyphLoader_CheckPoints
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)

wasm-ld: error: duplicate symbol: FT_GlyphLoader_CheckSubGlyphs
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)

```

How do I handle this?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [October 10, 2023, 2:31pm UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/6 "2023-10-10T14:31:19Z")

</div>

Have you tried `-DVTK_MODULE_ENABLE_VTK_RenderingFreeType:STRING=DONT_WANT`? @ben.boeckel may have some ideas.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 10, 2023, 2:38pm UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/7 "2023-10-10T14:38:06Z")

</div>

It looks like 9.2.6 has some unmangled symbols. Can you please test 9.3.0.rc1 so we can fix it if it needs to be?

---

<div class="post-metadata">

### Author: ![cebugdev](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cebugdev/32/7803_2.png) [@cebugdev](https://discourse.vtk.org/u/cebugdev)
#### Post date: [October 11, 2023, 2:06am UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/8 "2023-10-11T02:06:49Z")

</div>

Tried this still getting the errors

```auto
wasm-ld: error: duplicate symbol: FT_GlyphLoader_CreateExtra
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)

wasm-ld: error: duplicate symbol: ft_mem_realloc
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)

```

will try a different versions as suggested by Ben

Update: Tried a different version with 9.3 but same error ☹

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 11, 2023, 4:54pm UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/9 "2023-10-11T16:54:50Z")

</div>

Ok, it looks like we are missing some symbol manglings, at least on Windows. Can you please file an issue about this?

---

<div class="post-metadata">

### Author: ![cebugdev](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cebugdev/32/7803_2.png) [@cebugdev](https://discourse.vtk.org/u/cebugdev)
#### Post date: [October 12, 2023, 12:22am UTC](https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/10 "2023-10-12T00:22:44Z")

</div>

filed an issue in gitlab here: [https://gitlab.kitware.com/vtk/vtk/-/issues/19129](https://gitlab.kitware.com/vtk/vtk/-/issues/19129)
