# compile wasm failed

**URL:** https://discourse.vtk.org/t/compile-wasm-failed/12806
**Category:** Web
**Created:** [November 29, 2023, 10:54am UTC](https://discourse.vtk.org/t/compile-wasm-failed/12806 "2023-11-29T10:54:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![hu243285237](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hu243285237/32/7094_2.png) [@hu243285237](https://discourse.vtk.org/u/hu243285237)
#### Post date: [November 29, 2023, 10:54am UTC](https://discourse.vtk.org/t/compile-wasm-failed/12806/1 "2023-11-29T10:54:36Z")

</div>

I follow guide to compile build-vtk-wasm, use master branch, but i got this error:

vtkWebGPURenderWindow.cxx:197:29: error: no member named ‘Undefined’ in ‘wgpu::BackendType’  
case wgpu::BackendType::Undefined:

and soon on like this:

vtkWebGPURenderWindow.cxx:217:11: error: no member named ‘backendType’ in ‘wgpu::RequestAdapterOptions’  
options.backendType = this-\>RenderingBackendType;

i can compile success when switch branch to tag-9.3, but it lost some function i need, like ‘SetInputArray’

auto reader = vtkXMLUnstructuredGridReader::New();  
reader-\>SetInputArray(wrappedArray);

here is build command:

emcmake cmake   
-G “Ninja”   
-S ./src   
-B ./build-vtk-wasm   
-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=“./install”

cd ./build-vtk-wasm  
ninja

in addition, i didn’t use docker, i compile in local.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [November 29, 2023, 12:37pm UTC](https://discourse.vtk.org/t/compile-wasm-failed/12806/2 "2023-11-29T12:37:49Z")

</div>

@jaswantp

---

<div class="post-metadata">

### Author: ![hu243285237](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hu243285237/32/7094_2.png) [@hu243285237](https://discourse.vtk.org/u/hu243285237)
#### Post date: [November 30, 2023, 6:10am UTC](https://discourse.vtk.org/t/compile-wasm-failed/12806/3 "2023-11-30T06:10:58Z")

</div>

oh, i solved that problem, because i use emscripten version 3.1.38 before. it not show error after i update to latest version of 3.1.49

---

<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: [December 13, 2023, 2:19pm UTC](https://discourse.vtk.org/t/compile-wasm-failed/12806/4 "2023-12-13T14:19:53Z")

</div>

Glad you were able to solve it. The WebGPU rendering classes in VTK are experimental because webgpu C API is continuously being developed. Such change in struct definitions are to be expected for a while.
