# Trouble with New() function when using Emscripten

**URL:** https://discourse.vtk.org/t/trouble-with-new-function-when-using-emscripten/3080
**Category:** Development
**Created:** [April 17, 2020, 12:22pm UTC](https://discourse.vtk.org/t/trouble-with-new-function-when-using-emscripten/3080 "2020-04-17T12:22:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![claretb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/claretb/32/1466_2.png) [@claretb](https://discourse.vtk.org/u/claretb)
#### Post date: [April 17, 2020, 12:22pm UTC](https://discourse.vtk.org/t/trouble-with-new-function-when-using-emscripten/3080/1 "2020-04-17T12:22:01Z")

</div>

I’m trying to port my project to WebAssembly with Emscripten. I used [this](https://github.com/dicehub/VTK/tree/emscripten) source of VTK and some external libraries. And when I compiling a test project, I get the following warnings:

```
warning: undefined symbol: _ZN15vtkImageStencil3NewEv
warning: undefined symbol: _ZN16vtkImageYBRToRGB3NewEv
.
.
.

```

These warnings cause errors on browser and caused by New() functions. For example this:

`static vtkImageStencil *New();`

using:

`vtkImageStencil* imageStencil = vtkImageStencil::New();`

So what do you think about this problem? What can I do?

cc: @Sebastien_Jourdain @thewtex

---

<div class="post-metadata">

### Author: ![thewtex](https://discourse.vtk.org/user_avatar/discourse.vtk.org/thewtex/32/55_2.png) [@thewtex](https://discourse.vtk.org/u/thewtex)
#### Post date: [April 17, 2020, 1:43pm UTC](https://discourse.vtk.org/t/trouble-with-new-function-when-using-emscripten/3080/2 "2020-04-17T13:43:00Z")

</div>

@claretb this is likely an issue with the CMake configuration. To address this, use [itk.js](https://insightsoftwareconsortium.github.io/itk-js/) to prepare the project with a standard CMake configuration, and first verify that you can build it with a native C++ toolchain.

---

<div class="post-metadata">

### Author: ![claretb](https://discourse.vtk.org/user_avatar/discourse.vtk.org/claretb/32/1466_2.png) [@claretb](https://discourse.vtk.org/u/claretb)
#### Post date: [April 19, 2020, 7:57am UTC](https://discourse.vtk.org/t/trouble-with-new-function-when-using-emscripten/3080/3 "2020-04-19T07:57:45Z")

</div>

@thewtex

> [@thewtex](#):
>
> this is likely an issue with the CMake configuration.

Yes, I thought like you. And I checked many times this configurations. But I cannot find any solution for my problem.

> [@thewtex](#):
>
> To address this, use [itk.js](https://insightsoftwareconsortium.github.io/itk-js/) to prepare the project with a standard CMake configuration

I have a lot of questions about itk.js.

- We made some changes and additions in VTK and GDCM. Also we have a special library that uses them and OpenCV. So, How can I import this libraries to itk.js?

- I want to create instance on JS side because our project requires this. And I cannot found an example of this type. How can I use Emscripten bindings with itk.js?

- How can we add or change Emscripten flags at itk.js?

- Can we use builded js files without `runPipelineBrowser`?
