Linker error

Well I’m stumped. Where are the dependencies for the Java projects specfied in CMake?


Do you need Java support in VTK?

If yes, then take a look at this: installation of vtk 9.0 with python, java wrappers

If not, try disabling it in CMake: set VTK_WRAP_JAVA to OFF/NO.



I’ve built these wrappers many times and pushed fixes to the generation code.

On 29 Sept 2023 the vtkDrawTexturedElements was moved from $src/Rendering/GridCell to src/Rendering/OpenGL2 and this has somehow screwed up the Java wrapper dependency tree. This seems like a CMake issue to me.

It looks like vtkArrayRenderer uses multiple inheritance, the second of which is vtkDrawTexturedElements (which is not a VTK type and should not be wrapped). I suspect that the Java wrappers do not understand this in some way and get confused. It seems that Python wrapping does understand this and successfully wraps the class though (or just no-ops it and at least compiles).

Not sure what’s up with the LIC class though.

Cc: @jaswantp @dgobbi

Thanks Ben

It seems vtkArrayRenderer always had multiple inheritance on vtkMapper and vtkDrawTexturedElements but vtkArrayRenderer was also moved into $src/Rendering/OpenGL2 on 29 Sept.

Yes; it is probable that your builds weren’t enabling the RenderingCellGrid module since its addition in January.

Are you suggesting that starting a new build folder will fix the problem?

No? I’m saying that RenderingCellGrid is a module introduced in January. Your build probably did not enable it and that’s why it showed up once moved to RenderingOpenGL2. If it was working when it was in the initial module, the migration breaking it is of interest.

You could try getting the Java wrappers to ignore the extra base class:

   : public vtkMapper
+#ifndef __VTK_WRAP_JAVA__
   , public vtkDrawTexturedElements

The Python wrappers handle this automatically, and the Java wrappers could be modified so that they do the same.

Yea, this will be fine if you’re not using vtkDrawTexturedElements API. Right now, there’s no reason to, but I’m on a path to make vtkOpenGLPolyDataMapper subclass both vtkPolyDataMapper and vtkDrawTexturedElements.

The thing is vtkDrawTexturedElements offers a generic way to build a rendering pipeline where shaders can pull coordinates, colors, so on (aka vertex pulling) without being explicitly told what to render (aka the VBO approach). This paves the way for faster rendering with extremely low memory(RAM) footprint in VTK.

There are no plans to support multiple inheritance in the wrappers (except via the current method of ignoring all but the primary base class). So just make sure that vtkDrawTexturedElements doesn’t have any APIs that people might want to use at the application level…

Here is a possible fix: !10590