# Building vtkDICOM as a Remote VTK Module with Java Wrapping fails

**URL:** https://discourse.vtk.org/t/building-vtkdicom-as-a-remote-vtk-module-with-java-wrapping-fails/491
**Category:** Development
**Created:** [March 15, 2019, 8:55am UTC](https://discourse.vtk.org/t/building-vtkdicom-as-a-remote-vtk-module-with-java-wrapping-fails/491 "2019-03-15T08:55:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lars\_matthaeus](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/41988e/32.png) [@lars\_matthaeus](https://discourse.vtk.org/u/lars_matthaeus)
#### Post date: [March 15, 2019, 8:55am UTC](https://discourse.vtk.org/t/building-vtkdicom-as-a-remote-vtk-module-with-java-wrapping-fails/491/1 "2019-03-15T08:55:22Z")

</div>

I’m trying to build VTK on Windows with VS 2017 (x64, Release). I have enabled the vtkDicom module in CMAKE as well as the VTK\_WRAP\_JAVA option (Java 1.8). When building the solution in VS, I get a linker error for the vtkDICOMJava project:

vtkDICOMMetaDataJava.obj : error LNK2019: unresolved external symbol vtkDataObject\_Typecast referenced in function vtkDICOMMetaData\_Typecast  
xxx\VTK\bin\_2017\_x64\bin\Release\vtkDICOMJava.dll : fatal error LNK1120: 1 unresolved externals

If I disable the vtkDICOM module in CMAKE, the build runs fine.

Any ideas?  
Lars

---

<div class="post-metadata">

### Author: ![lars\_matthaeus](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/41988e/32.png) [@lars\_matthaeus](https://discourse.vtk.org/u/lars_matthaeus)
#### Post date: [March 15, 2019, 9:25am UTC](https://discourse.vtk.org/t/building-vtkdicom-as-a-remote-vtk-module-with-java-wrapping-fails/491/2 "2019-03-15T09:25:17Z")

</div>

Note that if I manually add “…\lib\Release\vtkCommonDataModelJava.lib” as Linker input for the vtkDICOMJava project in VS, everything works.

---

<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: [March 15, 2019, 1:48pm UTC](https://discourse.vtk.org/t/building-vtkdicom-as-a-remote-vtk-module-with-java-wrapping-fails/491/3 "2019-03-15T13:48:52Z")

</div>

Yes, vtkDICOMMetaData is derived from vtkDataObject, so I’ll have to add CommonDataModel as a core dependency for vtkDICOM. Thanks for confirming that adding it to the link solves the problem.

I’ll reply here when the patch is merged (probably today or tomorrow).

---

<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: [March 15, 2019, 3:51pm UTC](https://discourse.vtk.org/t/building-vtkdicom-as-a-remote-vtk-module-with-java-wrapping-fails/491/4 "2019-03-15T15:51:25Z")

</div>

I’ve merged a patch into master, now CommonDataModel should be linked in properly.
