Trouble with New() function when using Emscripten

I’m trying to port my project to WebAssembly with Emscripten. I used this 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();


vtkImageStencil* imageStencil = vtkImageStencil::New();

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

cc: @Sebastien_Jourdain @thewtex

@claretb this is likely an issue with the CMake configuration. To address this, use itk.js to prepare the project with a standard CMake configuration, and first verify that you can build it with a native C++ toolchain.


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

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?