Error building ITK 5.4 with CMake on MSVC 19.44: unresolved external symbol __std_find_first_of_trivial_pos_1

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):

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!

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.

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