cannot build Filtering Examples in vs2017

Hi,
I am new to ITK, however very experienced software engineer. I have download, built, and installed ITK on my windows 10 pc. I also have CMake 3.15.4. I created a CMake project using CMakeLists.txt samples in examples. I have src and bin folders for my FlipImageFilter project which actually is exactly copied from ITK/EXAMPLES/Filtering. I configure, generate code for vs2017 in CMake. I open my project in vs2017 but I cannot ALL_BUILD because itkImage.h, itkImageFileReader.h, itkImageFilterWriter.h, itkFlipImageFilter.h comiler errors. I also checked my c:/Program Files/ITK/include and the header files mentioned earlier exist in the folder, but No library for any of the filtering examples. although I am not supposed to model with settings in the vs2017 project, I added include paths to it it removed the compiler errors but it would not link because bunch of libraries are missing. I know somewhere in CMake something is wrong but more importantly I now doubt my ITK building and installation, even though I tested it with HelloWorld example. I can build and run segmentation sample like watershed though!!?
Need help, any ideas.
my version of ITK is the latest. I also partially installed Qt as well!

Regards,
sag

That’s not meant for a stand-alone example. CMakeLists.txt from HelloInsight page is a good starting point. The rest of your process sounds fine. You should not manually set include directories or link libraries. If you keep having issues, please provide the CMakeLists.txt file you are using.

thanks dzenanz: I SOLVED IT. problem was with my CMakeLists.txt file. I forgot to add following:

FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)

so you know what was my mistake!

thanks
sag

1 Like