# Linker error

**URL:** https://discourse.vtk.org/t/linker-error/12443
**Category:** Support
**Created:** [October 8, 2023, 6:51am UTC](https://discourse.vtk.org/t/linker-error/12443 "2023-10-08T06:51:35Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [October 8, 2023, 6:51am UTC](https://discourse.vtk.org/t/linker-error/12443/1 "2023-10-08T06:51:35Z")

</div>

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

 ![image](https://discourse.vtk.org/uploads/default/original/2X/0/0cbcaefd1eeb3c89675c5fc4315b8772f362cd67.png)

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [October 8, 2023, 12:28pm UTC](https://discourse.vtk.org/t/linker-error/12443/2 "2023-10-08T12:28:23Z")

</div>

Hi,

Do you need Java support in VTK?

If yes, then take a look at this: [installation of vtk 9.0 with python, java wrappers](https://discourse.vtk.org/t/installation-of-vtk-9-0-with-python-java-wrappers/3325)

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

best,

PC

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [October 10, 2023, 12:39am UTC](https://discourse.vtk.org/t/linker-error/12443/3 "2023-10-10T00:39:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 10, 2023, 12:46am UTC](https://discourse.vtk.org/t/linker-error/12443/4 "2023-10-10T00:46:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [October 10, 2023, 12:58am UTC](https://discourse.vtk.org/t/linker-error/12443/5 "2023-10-10T00:58:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 10, 2023, 11:04am UTC](https://discourse.vtk.org/t/linker-error/12443/6 "2023-10-10T11:04:48Z")

</div>

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

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [October 10, 2023, 12:43pm UTC](https://discourse.vtk.org/t/linker-error/12443/7 "2023-10-10T12:43:07Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 10, 2023, 1:45pm UTC](https://discourse.vtk.org/t/linker-error/12443/8 "2023-10-10T13:45:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [October 10, 2023, 2:05pm UTC](https://discourse.vtk.org/t/linker-error/12443/9 "2023-10-10T14:05:41Z")

</div>

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

```diff
 class VTKRENDERINGOPENGL2_EXPORT vtkArrayRenderer
   : public vtkMapper
+#ifndef __VTK_WRAP_JAVA__
   , public vtkDrawTexturedElements
+#endif
 {

```

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

---

<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: [October 10, 2023, 2:29pm UTC](https://discourse.vtk.org/t/linker-error/12443/10 "2023-10-10T14:29:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [October 10, 2023, 3:16pm UTC](https://discourse.vtk.org/t/linker-error/12443/11 "2023-10-10T15:16:18Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [October 10, 2023, 7:01pm UTC](https://discourse.vtk.org/t/linker-error/12443/12 "2023-10-10T19:01:26Z")

</div>

Here is a possible fix: [!10590](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10590)

---

<div class="post-metadata">

### Author: ![Kostas\_Politis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kostas_politis/32/4328_2.png) [@Kostas\_Politis](https://discourse.vtk.org/u/Kostas_Politis)
#### Post date: [January 11, 2024, 3:16pm UTC](https://discourse.vtk.org/t/linker-error/12443/13 "2024-01-11T15:16:52Z")

</div>

Hello all,

I am compiling v9.3.0 and I get the same error. Is there any workaround around this one?

For v9.3.0 there doesn’t seem to be a vtkArrayRendrer

Thanks,  
Kostas
