[Insight-developers] using vtk from itk

Sylvain Jaume sylvain.jaume at kitware.com
Wed Oct 18 19:20:55 EDT 2006


Hi Debbie,

Did you add the VTK libraries to TARGET_LINK_LIBRARIES?
For example:
TARGET_LINK_LIBRARIES( Vis ITKIO vtkIO vtkRendering )

Sylvain

debbie larson wrote:
> Hi,
> 
> Sorry this is a basic question. I have Itk and Vtk installed. I would 
> like to call vtk classes from itk code (C++). I added the following to 
> my CMakeLists.txt file in my itk project dir
> 
> # Find VTK.
> SET ( VTK_DIR /home/zona/RESEARCH_SUMMER_2006/VTK-BUILD )
> INCLUDE ( ${CMAKE_ROOT}/Modules/FindVTK.cmake )
> IF ( USE_VTK_FILE )
>   INCLUDE ( ${USE_VTK_FILE} )
> ENDIF ( USE_VTK_FILE )
> 
> When I make my itk code it will compile fine but it will not link. I get
> Linking CXX executable Vis
> CMakeFiles/Vis.dir/Vis.o: In function `main':
> CMakeFiles/Vis.dir/Vis.o(.text+0xb5): undefined reference to 
> `vtkImageReader2::New()'
> 
> 
> What else do I need to do?
> 
> Thanks
> 
> deb
> 
> _________________________________________________________________
> Get FREE company branded e-mail accounts and business Web site from 
> Microsoft Office Live 
> http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 


More information about the Insight-developers mailing list