# ITK DCMTK external build fails

**URL:** https://discourse.itk.org/t/itk-dcmtk-external-build-fails/2834
**Category:** Engineering
**Created:** [March 16, 2020, 9:34pm UTC](https://discourse.itk.org/t/itk-dcmtk-external-build-fails/2834 "2020-03-16T21:34:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tim-evain](https://discourse.itk.org/user_avatar/discourse.itk.org/tim-evain/32/220_2.png) [@tim-evain](https://discourse.itk.org/u/tim-evain)
#### Post date: [March 16, 2020, 9:34pm UTC](https://discourse.itk.org/t/itk-dcmtk-external-build-fails/2834/1 "2020-03-16T21:34:05Z")

</div>

Hello folks,

I’m currently building docker images for test automation and I’m facing an issue with the ITK-patched DCMTK external project. During the build I get this error (I’m building an image based on ubuntu 20.04 with gcc 9.3):

```auto
In file included from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/ofstd/include/dcmtk/ofstd/variadic/variant.h:19,
                 from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/ofstd/include/dcmtk/ofstd/ofvriant.h:379,
                 from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/dcmtls/include/dcmtk/dcmtls/tlsopt.h:28,
                 from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/dcmtls/libsrc/tlsopt.cc:27:
/root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/ofstd/include/dcmtk/ofstd/variadic/helpers.h:60:32: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing]
   60 | : OFintegral_constant<size_t,-1> {};
      | ^
make[5]: *** [dcmtls/libsrc/CMakeFiles/dcmtls.dir/build.make:89: dcmtls/libsrc/CMakeFiles/dcmtls.dir/tlsopt.cc.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:2633: dcmtls/libsrc/CMakeFiles/dcmtls.dir/all] Error 2
make[3]: *** [Makefile:141: all] Error 2
make[2]: *** [Modules/ThirdParty/DCMTK/CMakeFiles/ITKDCMTK_ExtProject.dir/build.make:112: Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject-prefix/src/ITKDCMTK_ExtProject-stamp/ITKDCMTK_ExtProject-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:6355: Modules/ThirdParty/DCMTK/CMakeFiles/ITKDCMTK_ExtProject.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

```

It seems that this is a problem that was already encountered, as the last patch by @matt.mccormick was on this precise topic, but corrected only for “emscripten” builds ? Could that fix be extended for all build ?

---

<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: [March 17, 2020, 2:55pm UTC](https://discourse.itk.org/t/itk-dcmtk-external-build-fails/2834/2 "2020-03-17T14:55:37Z")

</div>

@hjmjohnson it looks like

> <https://github.com/InsightSoftwareConsortium/ITK/commit/4e1a27d616d7a706749bc16f0c1373ce7253391e>

removed the required patches.

---

<div class="post-metadata">

### Author: ![tim-evain](https://discourse.itk.org/user_avatar/discourse.itk.org/tim-evain/32/220_2.png) [@tim-evain](https://discourse.itk.org/u/tim-evain)
#### Post date: [March 17, 2020, 3:21pm UTC](https://discourse.itk.org/t/itk-dcmtk-external-build-fails/2834/3 "2020-03-17T15:21:04Z")

</div>

I’ve forgotten to precise that I was trying to build the 5.0.1 tag, which I think is not affected by this commit ?

---

<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: [March 17, 2020, 3:34pm UTC](https://discourse.itk.org/t/itk-dcmtk-external-build-fails/2834/4 "2020-03-17T15:34:12Z")

</div>

5.1 RC 2 has this commit, which may address the build error (it has a different but related change).

That said, there were other patches on the ITK branch that may still be needed for other reasons, i.e. third-party integration, Emscripten.
