I am sorry if my problem is trivial, but I tried many solutions and nothing works out. I am trying to run a simple HelloWorld program, and make an inclusion of header file of ITK: itkImage.h
.
Running cmake ../src
to build the Makefile is okay.
But running make all
gives this error: /src/HelloWorldTwo.cpp:10:22: fatal error: itkImage.h: No such file or directory
#include "itkImage.h"
Find below my CMakeLists.txt
file and HelloWorldTwo.cpp
What I am missing here? I tried to run make command from Eclipse and from command window, but no success. I am sure the ITK_DIR
contains ITKConfig.cmake
, that's why cmake
is okay!
Thank you!
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(HelloWorldTwo)
# Find ITK.
set(ITK_DIR "/home/usr/itk/lib/cmake/ITK-4.13")
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
add_executable(HelloWorldTwo HelloWorldTwo.cpp)
target_link_libraries(HelloWorldTwo ${ITK_LIBRARIES})
HelloWorldTwo.cpp:
#include <iostream>
#include "itkImage.h"
using namespace std;
int main() {
cout << "Hello World!!!" << endl; // prints Hello World!!!
return 0;
}
Debugging the variables in CMakeLists.txt:
-- ITK_DIR: /home/usr/itk/lib/cmake/ITK-4.13
-- ITK_LIBRARIES: itkdouble-conversionitksysitkvnl_algoitkvnlitkv3p_netlibitknetlibitkvclITKCommonitkNetlibSlatecITKStatisticsITKTransformITKLabelMapITKMeshitkzlibITKMetaIOITKSpatialObjectsITKPathITKQuadEdgeMeshITKIOImageBaseITKOptimizersITKPolynomialsITKBiasCorrectionITKBioCellITKDICOMParserITKEXPATITKIOXMLITKIOSpatialObjectsITKFEMgdcmDICTgdcmMSFFITKznzITKniftiioITKgiftiiohdf5_cpp-statichdf5-staticITKIOBMPITKIOBioRadITKIOBrukerITKIOCSVITKIOGDCMITKIOIPLITKIOGEITKIOGIPLITKIOHDF5itkjpegITKIOJPEGitktiffITKIOTIFFITKIOLSMitkminc2ITKIOMINCITKIOMRCITKIOMeshITKIOMetaITKIONIFTIITKNrrdIOITKIONRRDitkpngITKIOPNGITKIOSiemensITKIOStimulateITKTransformFactoryITKIOTransformBaseITKIOTransformHDF5ITKIOTransformInsightLegacyITKIOTransformMatlabITKIOVTKITKKLMRegionGrowingitklbfgsITKOptimizersv4itkopenjpegITKVTKITKWatershedsITKReviewITKVideoCoreITKVideoIOITKVtkGlue