# Error building ITK 5.4 with CMake on MSVC 19.44: unresolved external symbol \_\_std\_find\_first\_of\_trivial\_pos\_1

**URL:** https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673
**Category:** Beginner Questions
**Tags:** itk
**Created:** [November 27, 2025, 3:11am UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673 "2025-11-27T03:11:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![thanhst](https://discourse.itk.org/user_avatar/discourse.itk.org/thanhst/32/4611_2.png) [@thanhst](https://discourse.itk.org/u/thanhst)
#### Post date: [November 27, 2025, 3:11am UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/1 "2025-11-27T03:11:18Z")

</div>

Hi ITK team,

I built ITK 5.4 using CMake and Visual Studio 2022. Everything compiles and links fine for most headers, but when I include `<itkImageFileReader.h>` in my project, I get the following linker error with file itksys-5.4.lib(SystemTools.obj):

```auto
unresolved external symbol __std_find_first_of_trivial_pos_1

```

Here are my build settings:

- ITK built as **DLL / Static library** (tried both)

- `CMAKE_CXX_STANDARD = 17`

- `MSVC runtime = MD`

- Project uses **same C++ standard and runtime** as ITK

- All required ITK libraries linked

Other headers, e.g., `<itkImage.h>` work fine.

Do you have any suggestions why this symbol is missing, or how to correctly build ITK to use `ImageFileReader` without linker errors?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [November 27, 2025, 5:46pm UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/2 "2025-11-27T17:46:35Z")

</div>

Are you pointing your project to ITK’s build directory, or an install directory? Using build directory is much more tested. I have a very similar setup, and I don’t remember encountering that error.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [November 27, 2025, 6:50pm UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/3 "2025-11-27T18:50:08Z")

</div>

This error sounds like a build gone wrong. Can you try clean and rebuild ITK? Does the problem still persist?

---

<div class="post-metadata">

### Author: ![thanhst](https://discourse.itk.org/user_avatar/discourse.itk.org/thanhst/32/4611_2.png) [@thanhst](https://discourse.itk.org/u/thanhst)
#### Post date: [November 28, 2025, 1:11am UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/4 "2025-11-28T01:11:29Z")

</div>

Thanks, sir! I’ll try again — really appreciate your help.

---

<div class="post-metadata">

### Author: ![thanhst](https://discourse.itk.org/user_avatar/discourse.itk.org/thanhst/32/4611_2.png) [@thanhst](https://discourse.itk.org/u/thanhst)
#### Post date: [November 28, 2025, 3:02am UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/5 "2025-11-28T03:02:06Z")

</div>

Dear Sir,

I ran `cmake --build . --target install` using the install folder because I wanted to get the headers quickly.

If I used the build folder, I would need to include many header files directly from the ITK source, which is quite large. Installing seemed easier to set up the include directories.

However, after doing this, I encountered the linker error I mentioned before.

I also noticed that some ITK documentation for building external projects recommends using CMake to create the project, but I wanted to use Visual Studio 2022 directly instead. I am not sure which folder(s) should be added to the Additional Include Directories.  
I apologize if my knowledge is still limited!

---

<div class="post-metadata">

### Author: ![thanhst](https://discourse.itk.org/user_avatar/discourse.itk.org/thanhst/32/4611_2.png) [@thanhst](https://discourse.itk.org/u/thanhst)
#### Post date: [November 28, 2025, 6:17am UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/6 "2025-11-28T06:17:59Z")

</div>

If I build my project using CMake, it works correctly.  
CMake can find ITK, link all the required modules, and the program runs without errors.

However, when I try to use Visual Studio 2022 directly, I manually add:

- the **install/include** folder to _Additional Include Directories_

- the **install/lib** folder to _Additional Library Directories_

- the ITK **.lib** files to _Input → Additional Dependencies_

When I build my project this way, Visual Studio gives me the linker error I mentioned earlier.

These are all the steps I performed. I think the issue happens because I am not using CMake to build my project.

Thank you for your help, sir.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [November 28, 2025, 1:59pm UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/7 "2025-11-28T13:59:08Z")

</div>

Take a look at this:

> [@ITK include directories for VS2017](https://discourse.itk.org/t/itk-include-directories-for-vs2017/589/4):
>
> @ankita [Here](https://public.kitware.com/pipermail/insight-users/2009-October/033164.html) is some old [discussion](https://public.kitware.com/pipermail/insight-users/2009-October/033176.html) about using ITK without CMake. In short, use CMake as meta-build system, and you don’t need to fiddle with include directories. If you don’t want to use CMake for whatever reason, configure some example project using CMake, generate a Visual Studio solution, and then you can copy include directories and link libraries from that example project to your own project.

---

<div class="post-metadata">

### Author: ![thanhst](https://discourse.itk.org/user_avatar/discourse.itk.org/thanhst/32/4611_2.png) [@thanhst](https://discourse.itk.org/u/thanhst)
#### Post date: [December 1, 2025, 2:02am UTC](https://discourse.itk.org/t/error-building-itk-5-4-with-cmake-on-msvc-19-44-unresolved-external-symbol-std-find-first-of-trivial-pos-1/7673/8 "2025-12-01T02:02:21Z")

</div>

Thank you, sir!
