[Insight-users] Can not include Itk head files

Matt McCormick matt.mccormick at kitware.com
Thu Oct 18 11:41:16 EDT 2012


On Thu, Oct 18, 2012 at 3:09 PM, psd <flydps at 163.com> wrote:
>  Hi, friends
>
> I am compiling an exist Itk program. When I make the files, I find that the
> Itk head files can not be find by the program. I think there must be some
> error in CMakelists.txt file. Can anyone give me some help, Thanks.
>
> The errors are like:  CSoucecodeTest/itktypes.h:5:30: error:
> itkOrientedImage.h: No such file or directory
> in the itktypes.h files I have included itk headers such as : #include
> "itkOrientedImage.h"
>
> And my CMakelists.txt file are as follow:
>
> cmake_minimum_required(VERSION 2.8)
> IF(COMMAND CMAKE_POLICY)
>   CMAKE_POLICY(SET CMP0003 NEW)
> ENDIF(COMMAND CMAKE_POLICY)
> PROJECT(peeve)
>
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> INCLUDE(${ITK_USE_FILE})
>
> ADD_EXECUTABLE(peeve peeve.cxx ext_functions.cxx)
> ADD_EXECUTABLE(peeve_rg peeve_rg.cxx ext_functions.cxx)
> ADD_EXECUTABLE(petpeeve_log petpeeve_log.cxx ext_fun ctions.cxx)
> SET(CMAKE_CXX_FLAGS "-g")
>
> TARGET_LINK_LIBRARIES(petpeeve ITKCommon ITKIO ITKAlgorithms)
> TARGET_LINK_LIBRARIES(petpeeve_rg ITKCommon ITKIO ITKAlgorithms)
> TARGET_LINK_LIBRARIES(petpeeve_log ITKCommon ITKIO ITKAlgorithms)

As John says, itkOrientedImage no longer exists -- just use itkImage instead.

Also
> TARGET_LINK_LIBRARIES(petpeeve ITKCommon ITKIO ITKAlgorithms)

should be

> TARGET_LINK_LIBRARIES(petpeeve ${ITK_LIBRARIES})

etc.

HTH,
Matt

>
>
> flydps
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list