# ITK with DCMTK building error

**URL:** <https://discourse.itk.org/t/itk-with-dcmtk-building-error/593>\
**Category:** Beginner Questions\
**Created:** [January 16, 2018, 2:01pm UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593 "2018-01-16T14:01:52Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![eninyo](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@eninyo](https://discourse.itk.org/u/eninyo)\
**Post date:** [May 13, 2019, 9:42am UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593/21 "2019-05-13T09:42:05Z")

</div>

hello,  
i have this link error as mentioned above.

> [@tim-evain](#):
>
> 2\>ofstd.lib(ofstd.obj) : error LNK2019: unresolved external symbol NetWkstaUserGetInfo referenced in function “public: static class OFString \_\_cdecl OFStandard::getUserName(void)” (?getUserName@OFStandard@@SA?AVOFString@@XZ)

i see the post is few months ago and i’m using version 3.6.4 of dcmtk, itk 4.13.2.

is the fix in those versions or should i do the patch also?

---

<div class="post-metadata">

**Author:** ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)\
**Post date:** [May 13, 2019, 1:08pm UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593/22 "2019-05-13T13:08:52Z")

</div>

@eninyo: It doesn’t look like the patch mentioned above made it into 4.13.2. Can you try using the latest version of ITK (5.0rc02 or master) and see if that solves your problem?  
Thanks!

---

<div class="post-metadata">

**Author:** ![eninyo](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@eninyo](https://discourse.itk.org/u/eninyo)\
**Post date:** [May 13, 2019, 2:28pm UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593/23 "2019-05-13T14:28:40Z")

</div>

@fbudin thanks for your reply.  
i want to use formal released version which is itk 4.13.2 as for now.

now the question is how do i apply the patch? (i’m new to it…)  
i download the sources and cmake it.  
any suggestions?

just to make it clear, the patch is on ITK and not DCMTK, right?  
as i see the changes in the patch are in the cmake files only, right?

---

<div class="post-metadata">

**Author:** ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)\
**Post date:** [May 13, 2019, 9:34pm UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593/24 "2019-05-13T21:34:54Z")

</div>

@eninyo: What is the value of the CMake variable `DCMTK_USE_ICU`? And what is your development platform (Windows, Mac, Linux)?  
If `DCMTK_USE_ICU` is set to `ON`, try setting it to `OFF` and see if that gets rid of your issue.

---

<div class="post-metadata">

**Author:** ![eninyo](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@eninyo](https://discourse.itk.org/u/eninyo)\
**Post date:** [May 15, 2019, 1:12pm UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593/25 "2019-05-15T13:12:05Z")

</div>

@fbudin I don’t have this (DCMTK\_USE\_ICU) at all in the itk cmake.  
did you mean dcmtk?

---

<div class="post-metadata">

**Author:** ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)\
**Post date:** [May 15, 2019, 2:14pm UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593/26 "2019-05-15T14:14:56Z")

</div>

@eninyo: It is both an ITK and a DCMTK option. Since you seem to be building DCMTK outside of ITK, then you should check the value of that option in the DCMTK build tree. However, I think that to address your problem, the other option that I mentioned in [this other post](https://discourse.itk.org/t/link-error-lnk2019/1865/3) is more likely to be helpful.

---

<div class="post-metadata">

**Author:** ![eninyo](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@eninyo](https://discourse.itk.org/u/eninyo)\
**Post date:** [May 16, 2019, 9:00am UTC](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593/27 "2019-05-16T09:00:38Z")

</div>

> [@fbudin](#):
>
> nd see if that gets rid of y

in cmake of DCMTK ICU is set to false, so I guess it is not the issue.  
I will try to add the iphlpapi ws2\_32 netapi32 wsock32 libs to the linking.

[Previous page](https://discourse.itk.org/t/itk-with-dcmtk-building-error/593.md?page=1)
