How to compile part of ITK integrated into another library?

Greetings to all!

While trying to compile part of the source code from ITK in my project I am having the following errors:

G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(83,3): error C3861: 'GetPimplGlobalsPointer': identifier not found
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(83,3): error C3535: cannot deduce type for 'auto *' from 'unknown-type'
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(86,65): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(116,3): error C3861: 'GetPimplGlobalsPointer': identifier not found
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(116,3): error C3535: cannot deduce type for 'auto *' from 'unknown-type'
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(117,8): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(120,5): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(122,10): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(124,7): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(126,7): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(132,10): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(135,1): error C2039: 'GetPimplGlobalsPointer': is not a member of 'itk::OutputWindow'
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.h(45): message : see declaration of 'itk::OutputWindow'
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(135,1): error C2065: 'm_PimplGlobals': undeclared identifier
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(135,1): error C2541: 'delete': cannot delete objects that are not pointers
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.cxx(137,37): error C2039: 'm_PimplGlobals': is not a member of 'itk::OutputWindow'
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkOutputWindow.h(45): message : see declaration of 'itk::OutputWindow'
3>  itkRegion.cxx
3>  itkMath.cxx
3>  G:\programming\cplusplus\CTK\External\VNL\src/vxl/core/vnl/vnl_math.h(41,12): fatal error C1083: Cannot open include file: 'vcl_msvc_warnings.h': No such file or directory
3>  itkNumericTraitsPointPixel.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkNumericTraitsFixedArrayPixel.cxx
3>  itkVector.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkVersion.cxx
3>  itkBuildInformation.cxx
3>  itkTotalProgressReporter.cxx
3>  itkPlatformMultiThreader.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkImageSourceCommon.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkImageRegionSplitterBase.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkImageIORegion.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkImageRegionSplitterSlowDimension.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkProcessObject.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
3>  itkDirectory.cxx
3>  G:\programming\cplusplus\CTK\Libs\mbilog\itkDirectory.h(22,10): fatal error C1083: Cannot open include file: 'itksys/Directory.hxx': No such file or directory
3>  Generating Code...

I cannot understand where does itkInitGlobalsMacro(PimplGlobals) is coming from…

What is it and where can I find its definition to fix that compilation error?

itkInitGlobalsMacro comes from itkSingletonMacro.h.

I found that by searching for itkInitGlobalsMacro in ITK repository on GitHub.

I kind of figured that out but what is not recognized is PimplGlobals.

It doesn’t compile at all.

I think that is defined by itkGetGlobalSimpleMacro, also in itkSingletonMacro.h.

Is the compilration error related to this :

up until :

This is about symbol visibility on Mac, it has nothing to do with itkOutputWindow.cxx compile errors.

How can I get rid of those compilation errors concerning

error C3861: ‘GetPimplGlobalsPointer’: identifier not found

Did you copy some files from one version of ITK, and some from another? PimplGlobals is defined here, I think.

The files are all here : https://github.com/al-sabr/CTK/tree/ctk-blueberry-port-from-mitk/Libs/mbilog

Oh I see now the file was maybe an old one when I replaced it with new one I am down to 15 errors.

Target ClCompile:
1>  mitkException.cpp
1>  G:\programming\cplusplus\CTK\Libs\mbilog\mitkException.cpp(43,26): error C2247: 'itk::ExceptionObject::GetDescription' not accessible because 'mitk::Exception' uses 'private' to inherit from 'itk::ExceptionObject'
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkExceptionObject.h(111): message : see declaration of 'itk::ExceptionObject::GetDescription'
1>  G:\programming\cplusplus\CTK\Libs\mbilog\mitkException.h(48): message : see declaration of 'mitk::Exception'
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkExceptionObject.h(49): message : see declaration of 'itk::ExceptionObject'
1>  mitkLog.cpp
1>  itkObjectFactoryBase.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkDirectory.h(22,10): fatal error C1083: Cannot open include file: 'itksys/Directory.hxx': No such file or directory
1>  itkDataObject.cxx
1>  itkThreadPool.cxx
1>  G:\programming\cplusplus\CTK\build\CTK-build\External\KWSys\src/itksys/SystemTools.hxx(6,10): fatal error C1083: Cannot open include file: 'itksys/Configure.hxx': No such file or directory
1>  itkMultiThreaderBase.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkRealTimeStamp.cxx
1>  itkOutputWindow.cxx
1>  itkMath.cxx
1>  G:\programming\cplusplus\CTK\External\VNL\src/vxl/core/vnl/vnl_math.h(41,12): fatal error C1083: Cannot open include file: 'vcl_msvc_warnings.h': No such file or directory
1>  itkNumericTraitsPointPixel.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkNumericTraitsFixedArrayPixel.cxx
1>  itkVector.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkVersion.cxx
1>  itkPlatformMultiThreader.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkImageSourceCommon.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkImageRegionSplitterBase.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkImageIORegion.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkImageRegionSplitterSlowDimension.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkProcessObject.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  itkDirectory.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkDirectory.h(22,10): fatal error C1083: Cannot open include file: 'itksys/Directory.hxx': No such file or directory
1>  Generating Code...
1>  Compiling...
1>  itkPoolMultiThreader.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory
1>  moc_mbilog.cpp
1>  moc_itkDirectory.cpp
1>  Generating Code...
1>Done building target "ClCompile" in project "CTKmbilog.vcxproj" -- FAILED.

I still cannot grasp this one :

1> G:\programming\cplusplus\CTK\Libs\mbilog\mitkException.cpp(43,26): error C2247: ‘itk::ExceptionObject::GetDescription’ not accessible because ‘mitk::Exception’ uses ‘private’ to inherit from 'itk::ExceptionObject’

What does this means? How can I fix this error :

2>G:\programming\cplusplus\CTK\Libs\mbilog\itkMath.h(780,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkMath.h(802,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkMath.h(780,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkMath.h(802,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(142,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(150,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(232,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier
2>G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(239,1): error C3646: 'ITK_NOEXCEPT': unknown override specifier

You can replace ITK_NOEXCEPT by noexcept. It used to be conditionally defined to either noexcept or `` depending on the version of C++ used. Since ITK 5 we always use C++11 which has noexcept.

It looks like you need to migrate to ITKv5 the libraries you are trying to merge. Doing that before merging will make your merge easier and more reliable.

I just defined this in itkConfig.h.in

#define ITK_NOEXCEPT = noexcept

The compilation is going through but now I have some other errors:

2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(375): message : see reference to class template instantiation 'itk::ImageRegion<VImageDimension>' being compiled
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(39): fatal error C1075: '{': no matching token found
2>  itkImageSourceCommon.cxx
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(375): message : see reference to class template instantiation 'itk::ImageRegion<VImageDimension>' being compiled
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(39): fatal error C1075: '{': no matching token found
2>  itkImageRegionSplitterBase.cxx
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(375): message : see reference to class template instantiation 'itk::ImageRegion<VImageDimension>' being compiled
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(39): fatal error C1075: '{': no matching token found
2>  itkImageIORegion.cxx
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(375): message : see reference to class template instantiation 'itk::ImageRegion<VImageDimension>' being compiled
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(39): fatal error C1075: '{': no matching token found
2>  itkImageRegionSplitterSlowDimension.cxx
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(375): message : see reference to class template instantiation 'itk::ImageRegion<VImageDimension>' being compiled
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(39): fatal error C1075: '{': no matching token found
2>  itkProcessObject.cxx
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(375): message : see reference to class template instantiation 'itk::ImageRegion<VImageDimension>' being compiled
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(39): fatal error C1075: '{': no matching token found
2>  itkDirectory.cxx
2>  itkNumericTraitsVectorPixel.cxx
2>  itkProgressReporter.cxx
2>  itkWin32OutputWindow.cxx
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkWin32OutputWindow.cxx(112,7): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>  itkPoolMultiThreader.cxx
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(375): message : see reference to class template instantiation 'itk::ImageRegion<VImageDimension>' being compiled
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(119,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(127,1): error C2238: unexpected token(s) preceding ';'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2059: syntax error: 'noexcept'
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(131,1): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
2>  G:\programming\cplusplus\CTK\Libs\mbilog\itkImageRegion.h(39): fatal error C1075: '{': no matching token found
2>  Generating Code...

Line 119 in itkImageRegion.h ImageRegion() ITK_NOEXCEPT = default;

I just removed all the ITK_NOEXCEPT from the source file and now I am down to only 1 error.

1> mitkException.cpp
1> G:\programming\cplusplus\CTK\Libs\mbilog\mitkException.cpp(43,26): error C2247: ‘itk::ExceptionObject::GetDescription’ not accessible because ‘mitk::Exception’ uses ‘private’ to inherit from 'itk::ExceptionObject’

So you could:

  • declare mitk::Exception: public itk::ExceptionObject (note public instead of private)
  • add in public section of mitk::Exception: using itk::ExceptionObject::GetDescription;
  • Add a method to mitk::Exception called GetDescription() to override the original declaration

This is the modification I made and now I am getting another error:

Generating Code...
1>Target Link:
1>     Creating library G:/programming/cplusplus/CTK/build/CTK-build/bin/Debug/CTKmbilog.lib and object G:/programming/cplusplus/CTK/build/CTK-build/bin/Debug/CTKmbilog.exp
1>  itkDirectory.obj : error LNK2019: unresolved external symbol "public: bool __cdecl itksys::Directory::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?Load@Directory@itksys@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAV34@@Z) referenced in function "public: bool __cdecl itk::Directory::Load(char const *)" (?Load@Directory@itk@@QEAA_NPEBD@Z)
1>  G:\programming\cplusplus\CTK\build\CTK-build\bin\Debug\CTKmbilog.dll : fatal error LNK1120: 1 unresolved externals
1>Done building target "Link" in project "CTKmbilog.vcxproj" -- FAILED.
1>
1>Done building project "CTKmbilog.vcxproj" -- FAILED.
1>
1>Build FAILED.
1>
1>itkDirectory.obj : error LNK2019: unresolved external symbol "public: bool __cdecl itksys::Directory::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?Load@Directory@itksys@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAV34@@Z) referenced in function "public: bool __cdecl itk::Directory::Load(char const *)" (?Load@Directory@itk@@QEAA_NPEBD@Z)
1>G:\programming\cplusplus\CTK\build\CTK-build\bin\Debug\CTKmbilog.dll : fatal error LNK1120: 1 unresolved externals
1>    0 Warning(s)
1>    2 Error(s)
1>
1>Time Elapsed 00:00:06.13
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

Directory.cxx does not seem to be compiled correctly.

This is where it is compiled : https://github.com/al-sabr/CTK/blob/8551b7341ee15d34d4a473c187ba13ba863bd817/CMakeLists.txt#L1349

It needs to be added as a dependency to ITK. ITK needs to link to KWSys. That’s what the error message is saying.

Although the compilation folder for KWSys shows

It cannot recognizes the missing files.

I am almost finished with compilation :

1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkDirectory.h(22,10): fatal error C1083: Cannot open include file: 'itksys/Directory.hxx': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkDataObject.cxx
1>    itkThreadPool.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkThreadPool.cxx(21,10): fatal error C1083: Cannot open include file: 'itksys/SystemTools.hxx': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkMultiThreaderBase.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkRealTimeStamp.cxx
1>    itkMath.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkMath.h(34,10): fatal error C1083: Cannot open include file: 'vnl/vnl_math.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkNumericTraitsPointPixel.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkNumericTraitsFixedArrayPixel.cxx
1>    itkVector.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkVersion.cxx
1>    itkBuildInformation.cxx
1>    itkPlatformMultiThreader.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkImageSourceCommon.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkImageRegionSplitterBase.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkImageIORegion.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkImageRegionSplitterSlowDimension.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkProcessObject.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkDirectory.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkDirectory.h(22,10): fatal error C1083: Cannot open include file: 'itksys/Directory.hxx': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    itkNumericTraitsVectorPixel.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    Generating Code...
1>    Compiling...
1>    itkPoolMultiThreader.cxx
1>  G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>    moc_itkProgressReporter.cpp
1>    Generating Code...
1>    CTKqtsingleapplication.vcxproj -> G:\programming\cplusplus\CTK\build\CTK-build\bin\Debug\CTKqtsingleapplication.dll
1>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'G:\programming\cplusplus\CTK\build\CMakeFiles\7bb6d10cf9d22863946eab39249063a3\CTK-build.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\7bb6d10cf9d22863946eab39249063a3\CTK-install.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\7bb6d10cf9d22863946eab39249063a3\CTK-forceconfigure.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\e3b53e276c6c7ab93bdcf23146530f56\CTK-complete.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\36161454dc3a55cd79af0104e2c07415\CTK.rule' exited with code 1.
1>Done building target "CustomBuild" in project "CTK.vcxproj" -- FAILED.
1>
1>Done building project "CTK.vcxproj" -- FAILED.
1>
1>Build FAILED.
1>
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkDirectory.h(22,10): fatal error C1083: Cannot open include file: 'itksys/Directory.hxx': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkThreadPool.cxx(21,10): fatal error C1083: Cannot open include file: 'itksys/SystemTools.hxx': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkMath.h(34,10): fatal error C1083: Cannot open include file: 'vnl/vnl_math.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkDirectory.h(22,10): fatal error C1083: Cannot open include file: 'itksys/Directory.hxx': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>G:\programming\cplusplus\CTK\Libs\mbilog\itkVector.h(23,10): fatal error C1083: Cannot open include file: 'vnl/vnl_vector_ref.h': No such file or directory [G:\programming\cplusplus\CTK\build\CTK-build\Libs\mbilog\CTKmbilog.vcxproj]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'G:\programming\cplusplus\CTK\build\CMakeFiles\7bb6d10cf9d22863946eab39249063a3\CTK-build.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\7bb6d10cf9d22863946eab39249063a3\CTK-install.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\7bb6d10cf9d22863946eab39249063a3\CTK-forceconfigure.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\e3b53e276c6c7ab93bdcf23146530f56\CTK-complete.rule;G:\programming\cplusplus\CTK\build\CMakeFiles\36161454dc3a55cd79af0104e2c07415\CTK.rule' exited with code 1.
1>    0 Warning(s)
1>    16 Error(s)
1>
1>Time Elapsed 00:01:04.45
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========