user3872358
user3872358

Reputation: 105

errors and warnings using ITK libraries

I am trying to use itk libraries in my own project. I built ITK with cmake 3.3 and I a using cmake to configure my own project. However when I try to build the project with Visual Studio 2012 I get the following warning(in Debug mode):

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xutility(2176): warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
2>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xutility(2157) : see declaration of 'std::_Copy_impl'
2>          c:\work\myproject\thirdparty\modules\io\imagebase\include\itkImageFileReader.hxx(441) : see reference to function template instantiation '_OutIt std::copy<const unsigned char*,unsigned char*>(_InIt,_InIt,_OutIt)' being compiled
2>          with
2>          [
2>              _OutIt=unsigned char *,
2>              _InIt=const unsigned char *
2>          ]
2>          c:\work\myproject\thirdparty\modules\io\imagebase\include\itkImageFileReader.hxx(353) : while compiling class template member function 'void itk::ImageFileReader<TOutputImage>::GenerateData(void)'
2>          with
2>          [
2>              TOutputImage=ImageType
2>          ]
2>          C:\Work\myproject\Main.cpp(77) : see reference to class template instantiation 'itk::ImageFileReader<TOutputImage>' being compiled
2>          with
2>          [
2>              TOutputImage=ImageType
2>          ]
2>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xutility(2157) : see declaration of 'std::_Copy_impl'

(after that there are warning about pdb files not appearing)

When I run the exe I get an exception in reader->Update(); in my file(appears later in my question)

This is my CMakeLists.txt file:

project(myproj)
 SET( EX_PLATFORM 64 )
 SET( EX_PLATFORM_NAME "x64" )
cmake_minimum_required(VERSION 2.6.0)
include_directories ("thirdParty/Modules/Segmentation/Watersheds/include"
                 "thirdParty/Modules/Segmentation/Voronoi/include"
                 "thirdParty/Modules/Video/IO/include"
                 "thirdParty/Modules/Video/Filtering/include"
                 "thirdParty/Modules/Video/Core/include"
                 "thirdParty/Modules/Bridge/VTK/include"
                 "thirdParty/Modules/Core/TestKernel/include"
                 "thirdParty/Modules/Filtering/SpatialFunction/include"
                 "thirdParty/Modules/Registration/RegistrationMethodsv4/include"
                 "thirdParty/Modules/Segmentation/RegionGrowing/include"
                 "thirdParty/Modules/Filtering/QuadEdgeMeshFiltering/include"
                 "thirdParty/Modules/Numerics/NeuralNetworks/include"
                 "thirdParty/Modules/Registration/Metricsv4/include"
                 "thirdParty/Modules/Numerics/Optimizersv4/include"
                 "thirdParty/Modules/Segmentation/MarkovRandomFieldsClassifiers/include"
                 "thirdParty/Modules/Segmentation/LevelSetsv4/include"
                 "thirdParty/Modules/Segmentation/LabelVoting/include"
                 "thirdParty/Modules/Segmentation/KLMRegionGrowing/include"
                 "thirdParty/Modules/Filtering/ImageNoise/include"
                 "thirdParty/Modules/Filtering/ImageFusion/include"
                 "thirdParty/Modules/IO/VTK/include"
                 "thirdParty/Modules/IO/TransformMatlab/include"
                 "thirdParty/Modules/IO/TransformInsightLegacy/include"
                 "thirdParty/Modules/IO/TransformHDF5/include"
                 "thirdParty/Modules/IO/TransformBase/include"
                 "thirdParty/Modules/IO/Stimulate/include"
                 "thirdParty/Modules/IO/Siemens/include"
                 "thirdParty/Modules/IO/RAW/include"
                 "thirdParty/Modules/IO/PNG/include"
                 "thirdParty/Modules/ThirdParty/PNG/src"
                 "thirdParty/itk_target/Modules/ThirdParty/PNG/src"
                 "thirdParty/Modules/IO/NRRD/include"
                 "thirdParty/Modules/ThirdParty/NrrdIO/src/NrrdIO"
                 "thirdParty/itk_target/Modules/ThirdParty/NrrdIO/src/NrrdIO"
                 "thirdParty/Modules/IO/NIFTI/include"
                  "thirdParty/Modules/IO/Meta/include"
                 "thirdParty/Modules/IO/Mesh/include"
                 "thirdParty/Modules/IO/MRC/include"
                 "thirdParty/Modules/IO/LSM/include"
                 "thirdParty/Modules/IO/TIFF/include"
                 "thirdParty/Modules/ThirdParty/TIFF/src"
                 "thirdParty/itk_target/Modules/ThirdParty/TIFF/src/itktiff"
                 "thirdParty/itk_target/Modules/ThirdParty/TIFF/src"
                 "thirdParty/Modules/IO/JPEG/include"
                 "thirdParty/Modules/ThirdParty/JPEG/src"
                 "thirdParty/itk_target/Modules/ThirdParty/JPEG/src"
                 "thirdParty/Modules/IO/HDF5/include"
                 "thirdParty/Modules/IO/GIPL/include"
                 "thirdParty/Modules/IO/GE/include"
                 "thirdParty/Modules/IO/IPL/include"
                 "thirdParty/Modules/IO/GDCM/include"
                 "thirdParty/Modules/IO/CSV/include"
                 "thirdParty/Modules/IO/BioRad/include"
                 "thirdParty/Modules/IO/BMP/include"
                 "thirdPartyitk_target/Modules/ThirdParty/HDF5/src"
                 "thirdParty/Modules/ThirdParty/HDF5/src"
                 "thirdParty/Modules/Filtering/GPUThresholding/include"
                 "thirdParty/Modules/Filtering/GPUSmoothing/include"
                 "thirdParty/Modules/Registration/GPUPDEDeformable/include"
                 "thirdParty/Modules/Registration/GPUCommon/include"
                 "thirdParty/Modules/Filtering/GPUImageFilterBase/include"
                 "thirdParty/Modules/Filtering/GPUAnisotropicSmoothing/include"
                 "thirdParty/Modules/Core/GPUFiniteDifference/include"
                 "thirdParty/Modules/Core/GPUCommon/include"
                 "thirdParty/Modules/ThirdParty/GIFTI/src/gifticlib"
                 "thirdParty/Modules/ThirdParty/NIFTI/src/nifti/znzlib"
                 "thirdParty/Modules/ThirdParty/NIFTI/src/nifti/niftilib"
                 "thirdParty/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition"
                 "thirdParty/Modules/ThirdParty/GDCM/src/gdcm/Source/MessageExchangeDefinition"
                 "thirdParty/Modules/ThirdParty/GDCM/src/gdcm/Source/InformationObjectDefinition"
                 "thirdParty/Modules/ThirdParty/GDCM/src/gdcm/Source/Common"
                 "thirdParty/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary"
                 "thirdParty/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat"
                 "thirdParty/itk_target/Modules/ThirdParty/GDCM/src/gdcm/Source/Common"
                 "thirdParty/itk_target/Modules/ThirdParty/GDCM"
                 "thirdParty/Modules/Registration/FEM/include"
                 "thirdParty/Modules/Registration/PDEDeformable/include"
                 "thirdParty/Modules/Numerics/FEM/include"
                 "thirdParty/Modules/Registration/Common/include"
                 "thirdParty/Modules/IO/SpatialObjects/include"
                 "thirdParty/Modules/IO/XML/include"
                 "thirdParty/Modules/ThirdParty/Expat/src/expat"
                 "thirdParty/itk_target/Modules/ThirdParty/Expat/src/expat"
                 "thirdParty/Modules/Numerics/Eigen/include"
                 "thirdParty/Modules/Filtering/DisplacementField/include"
                 "thirdParty/Modules/Filtering/DiffusionTensorImage/include"
                 "thirdParty/Modules/Filtering/Denoising/include"
                 "thirdParty/Modules/Segmentation/DeformableMesh/include"
                 "thirdParty/Modules/Filtering/Deconvolution/include"
                 "thirdParty/Modules/ThirdParty/DICOMParser/src/DICOMParser"
                 "thirdParty/itk_target/Modules/ThirdParty/DICOMParser/src/DICOMParser"
                 "thirdParty/Modules/Filtering/Convolution/include"
                 "thirdParty/Modules/Filtering/FFT/include"
                 "thirdParty/Modules/Filtering/Colormap/include"
                 "thirdParty/Modules/Segmentation/Classifiers/include"
                 "thirdParty/Modules/Segmentation/BioCell/include"
                 "thirdParty/Modules/Filtering/BiasCorrection/include"
                 "thirdParty/Modules/Numerics/Polynomials/include"
                 "thirdParty/Modules/Filtering/AntiAlias/include"
                 "thirdParty/Modules/Segmentation/LevelSets/include"
                 "thirdParty/Modules/Segmentation/SignedDistanceFunction/include"
                 "thirdParty/Modules/Numerics/Optimizers/include"
                 "thirdParty/Modules/Filtering/ImageFeature/include"
                 "thirdParty/Modules/Filtering/ImageSources/include"
                 "thirdParty/Modules/Filtering/ImageGradient/include"
                 "thirdParty/Modules/Filtering/Smoothing/include"
                 "thirdParty/Modules/Filtering/ImageCompare/include"
                 "thirdParty/Modules/Filtering/FastMarching/include"
                 "thirdParty/Modules/Core/QuadEdgeMesh/include"
                 "thirdParty/Modules/Filtering/DistanceMap/include"
                 "thirdParty/Modules/Numerics/NarrowBand/include"
                 "thirdParty/Modules/Filtering/BinaryMathematicalMorphology/include"
                 "thirdParty/Modules/Filtering/LabelMap/include"
                 "thirdParty/Modules/Filtering/MathematicalMorphology/include"
                 "thirdParty/Modules/Segmentation/ConnectedComponents/include"
                 "thirdParty/Modules/Filtering/Thresholding/include"
                 "thirdParty/Modules/Filtering/ImageLabel/include"
                 "thirdParty/Modules/Filtering/ImageIntensity/include"
                 "thirdParty/Modules/Filtering/Path/include"
                 "thirdParty/Modules/Filtering/ImageStatistics/include"
                 "thirdParty/Modules/Core/SpatialObjects/include"
                 "thirdParty/Modules/ThirdParty/MetaIO/src/MetaIO/src"
                 "thirdParty/itk_target/Modules/ThirdParty/MetaIO/src/MetaIO/src"
                 "thirdParty/Modules/ThirdParty/ZLIB/src"
                 "thirdParty/itk_target/Modules/ThirdParty/ZLIB/src"
                 "thirdParty/Modules/Core/Mesh/include"
                 "thirdParty/Modules/IO/ImageBase/include"
                 "thirdParty/itk_target/Modules/IO/ImageBase"
                 "thirdParty/Modules/Filtering/ImageCompose/include"
                 "thirdParty/Modules/Filtering/AnisotropicSmoothing/include"
                 "thirdParty/Modules/Filtering/ImageGrid/include"
                 "thirdParty/Modules/Core/ImageFunction/include"
                 "thirdParty/Modules/Core/Transform/include"
                 "thirdParty/Modules/Numerics/Statistics/include"
                 "thirdParty/itk_target/Modules/ThirdParty/Netlib"
                 "thirdParty/Modules/Core/ImageAdaptors/include"
                 "thirdParty/Modules/Filtering/CurvatureFlow/include"
                 "thirdParty/Modules/Filtering/ImageFilterBase/include"
                 "thirdParty/Modules/Core/FiniteDifference/include"
                 "thirdParty/Modules/Core/Common/include"
                "thirdParty/itk_target/Modules/Core/Common"
                 "thirdParty/Modules/ThirdParty/VNLInstantiation/include"
                 "thirdParty/itk_target/Modules/ThirdParty/VNL/src/vxl/core"
                 "thirdParty/itk_target/Modules/ThirdParty/VNL/src/vxl/vcl"
                 "thirdParty/itk_target/Modules/ThirdParty/VNL/src/vxl/v3p/netlib"
                 "thirdParty/Modules/ThirdParty/VNL/src/vxl/core"
                 "thirdParty/Modules/ThirdParty/VNL/src/vxl/vcl"
                 "thirdParty/Modules/ThirdParty/VNL/src/vxl/v3p/netlib"
                 "thirdParty/itk_target/Modules/ThirdParty/KWSys/src"
                "thirdParty/itk_target/Modules/ThirdParty/DoubleConversion/src/double-conversion"
                 "thirdParty/Modules/ThirdParty/DoubleConversion/src/double-conversion"
                 "thirdParty/Modules/ThirdParty/VNL/src/vxl/vcl/emulation"
                 )
SET(DEBUG_DIR  "../thirdParty/lib/Debug/")
SET(RELEASE_DIR "../thirdParty/lib/Release/")


SET(Sources "Main.cpp")


add_executable(myproj  ${Sources})

target_link_libraries(myproj 
                debug "${DEBUG_DIR}DeformableRegistration11"
                debug "${DEBUG_DIR}DeformableRegistration11"
                debug "${DEBUG_DIR}ITKBiasCorrection-4.8"
                debug "${DEBUG_DIR}ITKBioCell-4.8"
                debug "${DEBUG_DIR}ITKCommon-4.8"
                debug "${DEBUG_DIR}ITKDICOMParser-4.8"
                debug "${DEBUG_DIR}itkdouble-conversion-4.8"
                debug "${DEBUG_DIR}ITKEXPAT-4.8"
                debug "${DEBUG_DIR}ITKFEM-4.8"
                debug "${DEBUG_DIR}itkgdcmcharls-4.8"
                debug "${DEBUG_DIR}itkgdcmCommon-4.8"
                debug "${DEBUG_DIR}itkgdcmDICT-4.8"
                debug "${DEBUG_DIR}itkgdcmDSED-4.8"
                debug "${DEBUG_DIR}itkgdcmIOD-4.8"
                debug "${DEBUG_DIR}itkgdcmjpeg12-4.8"
                debug "${DEBUG_DIR}itkgdcmjpeg16-4.8"
                debug "${DEBUG_DIR}itkgdcmjpeg8-4.8"
                debug "${DEBUG_DIR}itkgdcmMEXD-4.8"
                debug "${DEBUG_DIR}itkgdcmMSFF-4.8"
                debug "${DEBUG_DIR}itkgdcmopenjpeg-4.8"
                debug "${DEBUG_DIR}itkgdcmsocketxx-4.8"
                debug "${DEBUG_DIR}ITKgiftiio-4.8"
                debug "${DEBUG_DIR}itkhdf5-4.8"
                debug "${DEBUG_DIR}itkhdf5_cpp-4.8"
                debug "${DEBUG_DIR}ITKIOBioRad-4.8"
                debug "${DEBUG_DIR}ITKIOBMP-4.8"
                debug "${DEBUG_DIR}ITKIOCSV-4.8"
                debug "${DEBUG_DIR}ITKIOGDCM-4.8"
                debug "${DEBUG_DIR}ITKIOGE-4.8"
                debug "${DEBUG_DIR}ITKIOGIPL-4.8"
                debug "${DEBUG_DIR}ITKIOHDF5-4.8"
                debug "${DEBUG_DIR}ITKIOImageBase-4.8"
                debug "${DEBUG_DIR}ITKIOIPL-4.8"
                debug "${DEBUG_DIR}ITKIOJPEG-4.8"
                debug "${DEBUG_DIR}ITKIOLSM-4.8"
                debug "${DEBUG_DIR}ITKIOMesh-4.8"
                debug "${DEBUG_DIR}ITKIOMeta-4.8"
                debug "${DEBUG_DIR}ITKIOMRC-4.8"
                debug "${DEBUG_DIR}ITKIONIFTI-4.8"
                debug "${DEBUG_DIR}ITKIONRRD-4.8"
                debug "${DEBUG_DIR}ITKIOPNG-4.8"
                debug "${DEBUG_DIR}ITKIOSiemens-4.8"
                debug "${DEBUG_DIR}ITKIOSpatialObjects-4.8"
                debug "${DEBUG_DIR}ITKIOStimulate-4.8"
                debug "${DEBUG_DIR}ITKIOTIFF-4.8"
                debug "${DEBUG_DIR}ITKIOTransformBase-4.8"
                debug "${DEBUG_DIR}ITKIOTransformHDF5-4.8"
                debug "${DEBUG_DIR}ITKIOTransformInsightLegacy-4.8"
                debug "${DEBUG_DIR}ITKIOTransformMatlab-4.8"
                debug "${DEBUG_DIR}ITKIOVTK-4.8"
                debug "${DEBUG_DIR}ITKIOXML-4.8"
                debug "${DEBUG_DIR}itkjpeg-4.8"
                debug "${DEBUG_DIR}ITKKLMRegionGrowing-4.8"
                debug "${DEBUG_DIR}ITKLabelMap-4.8"
                debug "${DEBUG_DIR}ITKMesh-4.8"
                debug "${DEBUG_DIR}ITKMetaIO-4.8"
                debug "${DEBUG_DIR}itkNetlibSlatec-4.8"
                debug "${DEBUG_DIR}ITKniftiio-4.8"
                debug "${DEBUG_DIR}ITKNrrdIO-4.8"
                debug "${DEBUG_DIR}ITKOptimizers-4.8"
                debug "${DEBUG_DIR}ITKOptimizersv4-4.8"
                debug "${DEBUG_DIR}ITKPath-4.8"
                debug "${DEBUG_DIR}itkpng-4.8"
                debug "${DEBUG_DIR}ITKPolynomials-4.8"
                debug "${DEBUG_DIR}ITKQuadEdgeMesh-4.8"
                debug "${DEBUG_DIR}ITKSpatialObjects-4.8"
                debug "${DEBUG_DIR}ITKStatistics-4.8"
                debug "${DEBUG_DIR}itksys-4.8"
                debug "${DEBUG_DIR}itktestlib-4.8"
                debug "${DEBUG_DIR}itktiff-4.8"
                debug "${DEBUG_DIR}itkv3p_lsqr-4.8"
                debug "${DEBUG_DIR}itkv3p_netlib-4.8"
                debug "${DEBUG_DIR}itkvcl-4.8"
                debug "${DEBUG_DIR}ITKVideoCore-4.8"
                debug "${DEBUG_DIR}ITKVideoIO-4.8"
                debug "${DEBUG_DIR}itkvnl-4.8"
                debug "${DEBUG_DIR}ITKVNLInstantiation-4.8"
                debug "${DEBUG_DIR}itkvnl_algo-4.8"
                debug "${DEBUG_DIR}ITKVTK-4.8"
                debug "${DEBUG_DIR}ITKWatersheds-4.8"
                debug "${DEBUG_DIR}itkzlib-4.8"
                debug "${DEBUG_DIR}ITKznz-4.8"
                debug "${DEBUG_DIR}DeformableRegistration1"

                optimized "${RELEASE_DIR}DeformableRegistration11"
                optimized "${RELEASE_DIR}DeformableRegistration11"
                optimized "${RELEASE_DIR}ITKBiasCorrection-4.8"
                optimized "${RELEASE_DIR}ITKBioCell-4.8"
                optimized "${RELEASE_DIR}ITKCommon-4.8"
                optimized "${RELEASE_DIR}ITKDICOMParser-4.8"
                optimized "${RELEASE_DIR}itkdouble-conversion-4.8"
                optimized "${RELEASE_DIR}ITKEXPAT-4.8"
                optimized "${RELEASE_DIR}ITKFEM-4.8"
                optimized "${RELEASE_DIR}itkgdcmcharls-4.8"
                optimized "${RELEASE_DIR}itkgdcmCommon-4.8"
                optimized "${RELEASE_DIR}itkgdcmDICT-4.8"
                optimized "${RELEASE_DIR}itkgdcmDSED-4.8"
                optimized "${RELEASE_DIR}itkgdcmIOD-4.8"
                optimized "${RELEASE_DIR}itkgdcmjpeg12-4.8"
                optimized "${RELEASE_DIR}itkgdcmjpeg16-4.8"
                optimized "${RELEASE_DIR}itkgdcmjpeg8-4.8"
                optimized "${RELEASE_DIR}itkgdcmMEXD-4.8"
                optimized "${RELEASE_DIR}itkgdcmMSFF-4.8"
                optimized "${RELEASE_DIR}itkgdcmopenjpeg-4.8"
                optimized "${RELEASE_DIR}itkgdcmsocketxx-4.8"
                optimized "${RELEASE_DIR}ITKgiftiio-4.8"
                optimized "${RELEASE_DIR}itkhdf5-4.8"
                optimized "${RELEASE_DIR}itkhdf5_cpp-4.8"
                optimized "${RELEASE_DIR}ITKIOBioRad-4.8"
                optimized "${RELEASE_DIR}ITKIOBMP-4.8"
                optimized "${RELEASE_DIR}ITKIOCSV-4.8"
                optimized "${RELEASE_DIR}ITKIOGDCM-4.8"
                optimized "${RELEASE_DIR}ITKIOGE-4.8"
                optimized "${RELEASE_DIR}ITKIOGIPL-4.8"
                optimized "${RELEASE_DIR}ITKIOHDF5-4.8"
                optimized "${RELEASE_DIR}ITKIOImageBase-4.8"
                optimized "${RELEASE_DIR}ITKIOIPL-4.8"
                optimized "${RELEASE_DIR}ITKIOJPEG-4.8"
                optimized "${RELEASE_DIR}ITKIOLSM-4.8"
                optimized "${RELEASE_DIR}ITKIOMesh-4.8"
                optimized "${RELEASE_DIR}ITKIOMeta-4.8"
                optimized "${RELEASE_DIR}ITKIOMRC-4.8"
                optimized "${RELEASE_DIR}ITKIONIFTI-4.8"
                optimized "${RELEASE_DIR}ITKIONRRD-4.8"
                optimized "${RELEASE_DIR}ITKIOPNG-4.8"
                optimized "${RELEASE_DIR}ITKIOSiemens-4.8"
                optimized "${RELEASE_DIR}ITKIOSpatialObjects-4.8"
                optimized "${RELEASE_DIR}ITKIOStimulate-4.8"
                optimized "${RELEASE_DIR}ITKIOTIFF-4.8"
                optimized "${RELEASE_DIR}ITKIOTransformBase-4.8"
                optimized "${RELEASE_DIR}ITKIOTransformHDF5-4.8"
                optimized "${RELEASE_DIR}ITKIOTransformInsightLegacy-4.8"
                optimized "${RELEASE_DIR}ITKIOTransformMatlab-4.8"
                optimized "${RELEASE_DIR}ITKIOVTK-4.8"
                optimized "${RELEASE_DIR}ITKIOXML-4.8"
                optimized "${RELEASE_DIR}itkjpeg-4.8"
                optimized "${RELEASE_DIR}ITKKLMRegionGrowing-4.8"
                optimized "${RELEASE_DIR}ITKLabelMap-4.8"
                optimized "${RELEASE_DIR}ITKMesh-4.8"
                optimized "${RELEASE_DIR}ITKMetaIO-4.8"
                optimized "${RELEASE_DIR}itkNetlibSlatec-4.8"
                optimized "${RELEASE_DIR}ITKniftiio-4.8"
                optimized "${RELEASE_DIR}ITKNrrdIO-4.8"
                optimized "${RELEASE_DIR}ITKOptimizers-4.8"
                optimized "${RELEASE_DIR}ITKOptimizersv4-4.8"
                optimized "${RELEASE_DIR}ITKPath-4.8"
                optimized "${RELEASE_DIR}itkpng-4.8"
                optimized "${RELEASE_DIR}ITKPolynomials-4.8"
                optimized "${RELEASE_DIR}ITKQuadEdgeMesh-4.8"
                optimized "${RELEASE_DIR}ITKSpatialObjects-4.8"
                optimized "${RELEASE_DIR}ITKStatistics-4.8"
                optimized "${RELEASE_DIR}itksys-4.8"
                optimized "${RELEASE_DIR}itktestlib-4.8"
                optimized "${RELEASE_DIR}itktiff-4.8"
                optimized "${RELEASE_DIR}itkv3p_lsqr-4.8"
                optimized "${RELEASE_DIR}itkv3p_netlib-4.8"
                optimized "${RELEASE_DIR}itkvcl-4.8"
                optimized "${RELEASE_DIR}ITKVideoCore-4.8"
                optimized "${RELEASE_DIR}ITKVideoIO-4.8"
                optimized "${RELEASE_DIR}itkvnl-4.8"
                optimized "${RELEASE_DIR}ITKVNLInstantiation-4.8"
                optimized "${RELEASE_DIR}itkvnl_algo-4.8"
                optimized "${RELEASE_DIR}ITKVTK-4.8"
                optimized "${RELEASE_DIR}ITKWatersheds-4.8"
                optimized "${RELEASE_DIR}itkzlib-4.8"
                optimized "${RELEASE_DIR}ITKznz-4.8"
                optimized "${RELEASE_DIR}DeformableRegistration1"


                )

this is the run file that I use to run the cmake

cd build 
cmake -G "Visual Studio 11 2012 Win64" ..
cd ..

this is my cpp file, it is a copy of the example found in (minus the comments)

#include "itkImage.h"
#include "itkImageFileReader.h"

int main( int , char * argv[])
{
  typedef unsigned char          PixelType;
  const unsigned int             Dimension = 3;
  typedef itk::Image< PixelType, Dimension >   ImageType;  
  typedef itk::ImageFileReader< ImageType >  ReaderType; 
  ReaderType::Pointer reader = ReaderType::New(); 
  const char * filename = argv[1];
  reader->SetFileName( filename ); 
  reader->Update();
  ImageType::Pointer image = reader->GetOutput();
  return EXIT_SUCCESS;
}

When I run the example with cmake everything builds and runs fine so probably the issue is with my cmakeLists. I've tried looking at all the itk cmake files but I was not able to figure out which configurations I should use. I tried using #define SCL_SECURE_NO_WARNINGS (acording to http://public.kitware.com/pipermail/insight-users/2010-September/037992.html) but that didn't help. I thought of using #define _SECURE_SCL 0 to allow checked iterators but since I get the exception when I'm in the RelWithDebInfo Mode I didn't think it would be helpful. Anyone have an idea on what else I can try/what error I have?

EDIT: the problem seems to not be connected to my cmakelists because when I try to build the "HelloWorldInsight" project (its the hello world project) I get the same checked iterator warning.

Upvotes: 0

Views: 1047

Answers (1)

lib
lib

Reputation: 2956

ry to keep your CMakeLists.txt file simple by using

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

Anyway, moving a built version of ITK is not so straightforward, you should not move the build directory but create an install directory . In brief you should:

  • in the cmakegui, set cmake_install prefix to some folder where you have permission to write (NOT the default C:/Program Files)
  • set the other options in the cmake gui, open ITK.sln in Visual Studio and build
  • from Visual Studio, select the project INSTALL in ITK.sln and "Build only this project". In the output you'll see that a bunch of files get copied You have to decide if you want to install the debug libraries or the release libraries, you can't install both in the same folder because they have the same name and will get overwritten

For nice screenshots, see the first steps of https://stackoverflow.com/a/26286268/1136458

Upvotes: 1

Related Questions