# Build Error MITK 2016.11: ITK targets not defined

**URL:** https://discourse.itk.org/t/build-error-mitk-2016-11-itk-targets-not-defined/626
**Category:** Beginner Questions
**Tags:** build, cmake
**Created:** [January 26, 2018, 7:08pm UTC](https://discourse.itk.org/t/build-error-mitk-2016-11-itk-targets-not-defined/626 "2018-01-26T19:08:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![norb](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/b38774/32.png) [@norb](https://discourse.itk.org/u/norb)
#### Post date: [January 26, 2018, 7:08pm UTC](https://discourse.itk.org/t/build-error-mitk-2016-11-itk-targets-not-defined/626/1 "2018-01-26T19:08:04Z")

</div>

Hello,

as Dzenan suggests in the mailing list, i write my question here to possibly get more attention or answers 🙂

```
Original post on mailing list:

```

> Hello,
> 
> I tried to build MITK (v2016.11) from source with external VTK (v8.1.0)  
> and external ITK (v4.13.0) on Windows 10 with MVSC 15 2017 Win64. ITK,  
> VTK and Qt is built with the same compiler (and so on) and works fine  
> running standalone.
> 
> Additionaly i added the paths to the .dll’s to the Windows system path before.
> 
> So, the MITK build went fine (except for a few warnings) until it  
> searches for ITK (i suppose it doesnt reached VTK settings); it shows  
> following error:
> 
> > CMake Error at  
> > C:/VisLibs/ITK4/InsightToolkit-4.13.0-build/ITKTargets.cmake:37 (message):  
> > Some (but not all) targets in this export set were already defined.  
> > Targets Defined:  
> > gdcmCommon; gdcmDICT; gdcmDSED; gdcmIOD; gdcmMEXD; gdcmMSFF;  
> > gdcmcharls; gdcmjpeg12; gdcmjpeg16; gdcmjpeg8; hdf5-static; hdf5\_cpp-static
> > 
> > Targets not yet defined:  
> > itkdouble-conversion; itksys; itkvcl; itkv3p\_netlib; itktestlib;  
> > itkvnl; itkvnl\_algo; itknetlib; ITKVNLInstantiation; ITKCommon;  
> > itkNetlibSlatec; ITKStatistics; ITKTransform; ITKLabelMap; ITKMesh;  
> > itkzlib; ITKMetaIO; ITKSpatialObjects; ITKPath; ITKQuadEdgeMesh;  
> > ITKIOImageBase; ITKOptimizers; ITKPolynomials; ITKBiasCorrection;  
> > ITKBioCell; ITKDICOMParser; ITKEXPAT; ITKIOXML; ITKIOSpatialObjects;  
> > ITKFEM; itkgdcmopenjp2; gdcmsocketxx; ITKznz; ITKniftiio; ITKgiftiio;  
> > GTest::GTest; GTest::Main; ITKIOBMP; ITKIOBioRad; ITKIOBruker; ITKIOCSV;  
> > ITKIOGDCM; ITKIOIPL; ITKIOGE; ITKIOGIPL; ITKIOHDF5; itkjpeg; ITKIOJPEG;  
> > itktiff; ITKIOTIFF; ITKIOLSM; itkminc2 //[… and so on]
> > 
> > Call Stack (most recent call first):  
> > C:/VisLibs/ITK4/InsightToolkit-4.13.0-build/ITKConfig.cmake:64 (include)  
> > CMakeLists.txt:758 (find\_package)
> > 
> > – Configuring incomplete, errors occurred!  
> > See also  
> > “C:/VisLibs/MITK2016/MITK-build/MITK-build/CMakeFiles/CMakeOutput.log”.  
> > C:\Program Files (x86)\Microsoft Visual  
> > Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5):  
> > error MSB6006: “cmd.exe” exited with code 1.  
> > Done building project “MITK-Configure.vcxproj” – FAILED.
> 
> So, somehow it cannot include all the ITK libraries. Path to  
> ITKConfig.cmake is well set as i see. Any ideas how to solve this? Is  
> this a problem related to the CMake files of MITK or should i apply some  
> additional configuration to the ITK build?

Thanks  
Norbert

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [January 26, 2018, 7:29pm UTC](https://discourse.itk.org/t/build-error-mitk-2016-11-itk-targets-not-defined/626/2 "2018-01-26T19:29:07Z")

</div>

Hello Norbert,

A few things to try:

- Make sure the ITK build completed successfully (so the targets exist)
- Use a shorter path for the ITK and VTK build tree. Visual Studio has path length issues.
- Check in with the MITK folks.

HTH,  
Matt

---

<div class="post-metadata">

### Author: ![norb](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/b38774/32.png) [@norb](https://discourse.itk.org/u/norb)
#### Post date: [January 26, 2018, 7:35pm UTC](https://discourse.itk.org/t/build-error-mitk-2016-11-itk-targets-not-defined/626/3 "2018-01-26T19:35:45Z")

</div>

Hey Matt,

thanks for your quick response!

- ITK build completed successfully

> Use a shorter path for the ITK and VTK build tree. Visual Studio has path length issues.

- well, in my opinion its short 😃 also building & running the ITK Hello World works

> Check in with the MITK folks.

Well, they’re not as quick as you are. I just want to make sure that i do not have to make an extra build configuration for ITK when using it with MITK.

---

<div class="post-metadata">

### Author: ![kayarre](https://discourse.itk.org/user_avatar/discourse.itk.org/kayarre/32/669_2.png) [@kayarre](https://discourse.itk.org/u/kayarre)
#### Post date: [November 27, 2018, 7:08pm UTC](https://discourse.itk.org/t/build-error-mitk-2016-11-itk-targets-not-defined/626/4 "2018-11-27T19:08:43Z")

</div>

Were you able to figure out this issue?  
I am having a similar problem with gdcm.

I think the solution might be:

[http://itk-users.7.n7.nabble.com/ITK-users-Problem-using-CMAKE-including-ITK-VTK-and-GDCM-td38933.html](http://itk-users.7.n7.nabble.com/ITK-users-Problem-using-CMAKE-including-ITK-VTK-and-GDCM-td38933.html)

or in my case i needed to specify the gdcm directory in the cmake files
