ITK installation error

Hi I’m trying to build ITK.
I’m using windows.
I have downloaded the source code and configured and generate with cmake.
next I opened ITK.sln with visual studio 2019 and start building ALL_BUILD.

after the build is finished I got 28 errors and 5 warnings.
here’s what I got

Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\itkv3p_netlib.dir\Debug\itkv3p_netlib.pdb	itkv3p_netlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\c_abs.c	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\itkv3p_netlib.dir\Debug\itkv3p_netlib.pdb	itkv3p_netlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\f77_aloc.c	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\itkv3p_netlib.dir\Debug\itkv3p_netlib.pdb	itkv3p_netlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\d_cnjg.c	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\itkv3p_netlib.dir\Debug\itkv3p_netlib.pdb	itkv3p_netlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\c_div.c	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\itkv3p_netlib.dir\Debug\itkv3p_netlib.pdb	itkv3p_netlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\cabs.c	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\itkv3p_netlib.dir\Debug\itkv3p_netlib.pdb	itkv3p_netlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\exit_.c	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\itkv3p_netlib.dir\Debug\itkv3p_netlib.pdb	itkv3p_netlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\c_sqrt.c	1	
Error	D8040	error creating or communicating with child process	itkv3p_netlib	C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\cl	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\itkvnl.dir\Debug\itkvnl.pdb	itkvnl	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_block.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\itkvnl.dir\Debug\itkvnl.pdb	itkvnl	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_matlab_print_scalar.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\itkvnl.dir\Debug\itkvnl.pdb	itkvnl	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_alloc.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\itkvnl.dir\Debug\itkvnl.pdb	itkvnl	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_error.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\itkvnl.dir\Debug\itkvnl.pdb	itkvnl	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_math.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\itkvnl.dir\Debug\itkvnl.pdb	itkvnl	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_matlab_print_format.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\itkvnl.dir\Debug\itkvnl.pdb	itkvnl	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\vnl_na.cxx	1	
Error	D8040	error creating or communicating with child process	itkvnl	C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\cl	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\itkvnl_algo.dir\Debug\itkvnl_algo.pdb	itkvnl_algo	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\vnl_sparse_lu.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\itkvnl_algo.dir\Debug\itkvnl_algo.pdb	itkvnl_algo	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\vnl_generalized_schur.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\itkvnl_algo.dir\Debug\itkvnl_algo.pdb	itkvnl_algo	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\vnl_real_eigensystem.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\itkvnl_algo.dir\Debug\itkvnl_algo.pdb	itkvnl_algo	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\vnl_ldl_cholesky.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\itkvnl_algo.dir\Debug\itkvnl_algo.pdb	itkvnl_algo	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\vnl_cholesky.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\itkvnl_algo.dir\Debug\itkvnl_algo.pdb	itkvnl_algo	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\vnl_complex_eigensystem.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\itkvnl_algo.dir\Debug\itkvnl_algo.pdb	itkvnl_algo	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\vnl_sparse_symmetric_eigensystem.cxx	1	
Error	D8040	error creating or communicating with child process	itkvnl_algo	C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo\cl	1	
Warning	C4834	discarding return value of function with 'nodiscard' attribute	ITKDICOMParser	C:\itk\src\Modules\ThirdParty\DICOMParser\src\DICOMParser\DICOMParser.cxx	830	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\testlib\itktestlib.dir\Debug\itktestlib.pdb	itktestlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\testlib\testlib_root_dir.cxx	1	
Error	C1090	PDB API call failed, error code '3': C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\testlib\itktestlib.dir\Debug\itktestlib.pdb	itktestlib	C:\itk\src\Modules\ThirdParty\VNL\src\vxl\core\testlib\testlib_test.cxx	1	
Error	D8040	error creating or communicating with child process	itktestlib	C:\itk\bin\Modules\ThirdParty\VNL\src\vxl\core\testlib\cl	1	
Warning	C4819	The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss	ITKIONRRD	C:\itk\bin\Modules\ThirdParty\NrrdIO\src\NrrdIO\NrrdIO.h	1	
Warning	C4819	The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss	ITKOptimizersv4	C:\itk\src\Modules\Numerics\Optimizersv4\include\itkLBFGSOptimizerv4.h	1	
Warning	C4819	The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss	ITKOptimizersv4	C:\itk\src\Modules\Numerics\Optimizersv4\include\itkLBFGS2Optimizerv4.h	1	
Warning	C4834	discarding return value of function with 'nodiscard' attribute	ITKIOGE	C:\itk\src\Modules\IO\GE\src\itkGE5ImageIO.cxx	300	
Error	LNK1104	cannot open file '..\..\..\..\lib\Debug\itkvnl_algo-5.0.lib'	itkTestDriver	C:\itk\bin\Modules\Core\TestKernel\src\LINK	1	

I have no idea what these errors mean.
how can I fix it?

It is a bug in Visual Studio. Workaround is possible, but newer versions of ITK compile out of the box. Why don’t you try 5.1.0, a stable release which was tagged recently (but not yet announced).

1 Like

I just tried 5.1.0

and I got 3 warnings and 2 errors.

Severity	Code	Description	Project	File	Line	Suppression State
Warning	C4819	The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss	VisibleHumanStreamReadWrite	C:\itk\src\Examples\IO\VisibleHumanStreamReadWrite.cxx	1	
Warning	C4834	discarding return value of function with 'nodiscard' attribute	ITKDICOMParser	C:\itk\src\Modules\ThirdParty\DICOMParser\src\DICOMParser\DICOMParser.cxx	830	
Warning	C4819	The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss	ITKIONRRD	C:\itk\bin\Modules\ThirdParty\NrrdIO\src\NrrdIO\NrrdIO.h	1	
Error	MSB6003	The specified task executable "link.exe" could not be run. System.IO.IOException: The process cannot access the file 'DTITubeSpatialObject.dir\Debug\DTITubeS.7F53AA24.tlog\link-rc.write.1.tlog' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileInfo.Delete()
   at Microsoft.Build.CPPTasks.TrackedVCToolTask.DeleteEmptyFile(ITaskItem[] filesToDelete)
   at Microsoft.Build.CPPTasks.TrackedVCToolTask.PostExecuteTool(Int32 exitCode)
   at Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
   at Microsoft.Build.Utilities.ToolTask.Execute()	DTITubeSpatialObject	C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets	854	
Error	MSB6003	The specified task executable "link.exe" could not be run. System.IO.IOException: The process cannot access the file 'ImageSpatialObject.dir\Debug\ImageSpa.6CE600E4.tlog\link.read.3.tlog' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileInfo.Delete()
   at Microsoft.Build.CPPTasks.TrackedVCToolTask.DeleteEmptyFile(ITaskItem[] filesToDelete)
   at Microsoft.Build.CPPTasks.TrackedVCToolTask.PostExecuteTool(Int32 exitCode)
   at Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
   at Microsoft.Build.Utilities.ToolTask.Execute()	ImageSpatialObject	C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets	854

Warnings are unimportant, meaning some variable names or comments have characters not supported by Korean code page.

Regarding errors, maybe you have an overzealous antivirus? Or it might be yet another bug in Visual Studio. Try doing an incremental build (F7 or Ctrl+B). If the error persists, report a bug in Visual Studio.

I haven’t finished build(It takes very long time on my computer…)

the build is about 50% done and I can see that I still have error with incremental build.

do you have any thoughts about this error?
If you have could you share?
I don’t have much time to report a bug and wait right now…

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK1104	cannot open file 'python37_d.lib'	ITKIOHDF5Python	C:\itk\bin\Wrapping\Modules\ITKIOHDF5\LINK	1	
Error	MSB6006	"cmd.exe" exited with code 1.	ITKData	C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets	231

Debug version of Python library is optional, and is off by default when installing Python. I don’t remember whether building in Debug mode requires it. Building in Release or RelWithDebInfo will not need it. So try that.

@dzenanz I’m afraid that the PDB errors are back, with the latest VS2019 update!!! Visual Studio 2019 Version 16.10.4 (July 20, 2021) (Debug configuration) appears to produce, using Compiler Version 19.29.30040 for x64:

3>C:\X\src\ITK\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\c_div.c : fatal error C1090: PDB API call failed, error code ‘3’: C:\X\bin\ITK\lib\Debug\itkv3p_netlib-5.3.pdb
3>C:\X\src\ITK\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\exit_.c : fatal error C1090: PDB API call failed, error code ‘3’: C:\X\bin\ITK\lib\Debug\itkv3p_netlib-5.3.pdb
3>C:\X\src\ITK\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\c_abs.c : fatal error C1090: PDB API call failed, error code ‘3’: C:\X\bin\ITK\lib\Debug\itkv3p_netlib-5.3.pdb
3>C:\X\src\ITK\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\libf2c\c_sqrt.c : fatal error C1090: PDB API call failed, error code ‘3’: C:\X\bin\ITK\lib\Debug\itkv3p_netlib-5.3.pdb
3>C:\X\src\ITK\Modules\ThirdParty\VNL\src\vxl\v3p\netlib\v3p_netlib_init.c : fatal error C1090: PDB API call failed, error code ‘3’: C:\X\bin\ITK\lib\Debug\itkv3p_netlib-5.3.pdb
3>cl : command line error D8040: error creating or communicating with child process

I think the original VXL workaround, committed by @hjmjohnson on 15 Aug 2019, using the /FS compile option, is broken by VS2019 16.10.4. (16.10.3 still builds fine.) Has anyone else experienced the “comeback” of this build error?

Update: Just opened another issue on this compile error: Visual Studio 2019 16.10.4 VXL fatal error C1090: PDB API call failed, error code ‘3’ · Issue #2661 · InsightSoftwareConsortium/ITK · GitHub

I think @tapphughesn encountered it. It is probably best to re-raise this with Microsoft.

EDIT: I see you created a bug report at VS developer community.

It looks like those fatal PDB errors don’t appear when using an older CMake version (CMake 3.20.4 or older)! They only reappear when using the latest release, CMake 3.21.0 (or one of its release candidates). This may be caused by the way CMake processes add_compile_options( "/FS" ), as in VNL/src/vxl/CMakeLists.txt CMake 3.20.4 just adds "/FS" to the <AdditionalOptions> XML element, in the generated vcxproj files, whereas CMake 3.21.0 adds a <ForceSynchronousPDBWrites> element instead.

I just asked @brad.king whether this change is intended, and how to get the old behavior from CMake, in a comment from ITK issue 2661

Anyway, I still hope to get more feedback as well on the Visual Studio bug, at Visual Studio Feedback Please upvote the compiler bug, if you agree that it should be fixed!

Update: just submitted the issue to CMake as well: "MSVC compile option “/FS” should be added to <AdditionalOptions>, not just <ForceSynchronousPDBWrites>", https://gitlab.kitware.com/cmake/cmake/-/issues/22476 Please check the issue, and “like”, if you agree!

1 Like