Error during VTK 9.3.0 build from sources with Java Wrapper

Hello!
I am trying to build the VTK version 9.3.0 from git sources (commit 357d9ef) on Windows 11 x64. I was following these instructions and set the VTK_WRAP_JAVA=ON because I need the VTK.jar file. After executing the
cmake --build %HOMEPATH%\vtk\build --config Release
command, it run into the following error:

vtkCompositeSurfaceLICMapperJava.cxx.obj : error LNK2019: unresolved external symbol vtkCompositePolyDataMapper_Typecast referenced in function vtkCompositeSurfaceLICMapper_Typecast
lib\java\vtk-Windows-AMD64\vtkRenderingLICOpenGL2Java.dll : fatal error LNK1120: 1 unresolved externals

Does anyone know how to resolve the error?

I am using:
CMake v3.28.3
ninja v1.11.1
Visual Studio 2022 (I also tried using 2019 and 2017)
Java 17

I also tried building it with CMake GUI and Visual Studio, but got the same error.

Any advice would be highly appreciated.

I met exactly the same problem with you.

Compared with previously successfully compiled projects, such like the project ‘vtkRenderingOpenGL2Java’, the error occuring project ‘vtkRenderingLICOpenGL2Java’ seems to be lack of the necessary reference to the project ‘vtkRenderingCoreJava’, where the symbol ‘vtkCompositePolyDataMapper_Typecast’ defined in.

Simply add the project reference and manually add ‘…..\lib\Debug\vtkRenderingCoreJava.lib’ to the additional link libraries of the error compiling project will fix the problem.

This works on my computer, Win10, Visual Studio 2022 with VC++ 141, VTK 9.3.0, sun JDK 1.8.

@vbolea

We have resolved this (along many other changes to the Java Wrappings) in current VTK master, unfortunately it did not make it to 9.3.X and we do not expect another 9.3.X release. In any case this will be included in the incoming 9.4.0 release which is due to next months.

Thanks for reporting this issue.