[Insight-users] Re: InsightToolkit-2.0.0\Examples\DataRepresentation\Image compile problem

Luis Ibanez luis.ibanez at kitware.com
Mon Feb 28 14:45:22 EST 2005


Hi Albert,

The Examples in ITK are configured to be built along
with the rest of the toolkit.

If you want to extract and example out of the ITK
source tree and run it as an independent new project,
you should create a new CMakeLists.txt file for it.

This is quite simply.
Just follow the instructions in the tutorial session:

http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/img0.html



or the instructions in the ITK Software Guide:

    http://www.itk.org/ItkSoftwareGuide.pdf


A typical example of the minimal CMakeLists.txt file
is the one available at:


    /Insight/Examples/Installation/CMakeLists.txt


it contains the following text:


PROJECT(HelloWorld)

# Find ITK.
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
   INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
   MESSAGE(FATAL_ERROR
           "Cannot build without ITK.  Please set ITK_DIR.")
ENDIF(ITK_FOUND)

ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )

TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)




Please let us know if you have any further questions,


    Thanks


      Luis



---------------------------------------------
Wang, Albert/Sloan-Kettering Institute wrote:

> Hi Luis;
> 
> I am learning itk programming from examples program. I created a
> directory bin under
> InsightToolkit-2.0.0\Examples\DataRepresentation\Image to hold Cmake's
> "where to hold binaries". In "where is the source code", I put
> InsightToolkit-2.0.0\Examples\DataRepresentation\Image.  Then click
> "configure" button and "OK" button.  Cmake works fine and created
> ImageExamples.dsw.  Then I use VC++6  to compile, I got the following
> error:
> 
> --------------------Configuration: Image1 - Win32
> Debug--------------------
> Compiling...
> Image1.cxx
> D:\Projects\Deform_Reg\itk2.0.0\InsightToolkit-2.0.0\Examples\DataRepres
> entation\Image\Image1.cxx(33) : fatal error C1083: Cannot open include
> file: 'itkImage.h': No such file or directory
> Error executing cl.exe.
> 
> ALL_BUILD - 1 error(s), 0 warning(s)
> 
> Can you tell me why?
> 
> Thanks.
> 
> Albert
> 
> 
> 
> 
> 





More information about the Insight-users mailing list