[Insight-users] VTK_LIBRARIES empty?

Luis Ibanez luis.ibanez at kitware.com
Fri, 09 Apr 2004 12:03:54 -0400


Hi Toon,

In InsightApplications we usually put
the explicit list of VTK libraries that
are needed by the application.

You may want to look at the CMakeLists.txt files
in the subdirectories of InsightApplications.

For example to:

    InsightApplications/
             RegionGrowingSegmentation

    InsightApplications/
             GeodesicActiveContours


that use expressions such as:


TARGET_LINK_LIBRARIES(GeodesicActiveContour
   ITKNumerics
   ITKBasicFilters
   ITKIO
   vtkHybrid
   vtkIO
   ITKVtkFltk
   ITKFltkImageViewer
)



Regards,


    Luis


---------------------
Toon Huysmans wrote:

> Hi All,
> 
>     It seems that the variable VTK_LIBRARIES is not defined in vtk 4.2,
> because when looking in the project settings, only ITK and FLTK libs are
> linked to, no VTK libs.
>     This results in a unresolved external:
> 
>          THCochleaSegmentationII.obj : error LNK2019: unresolved external
> symbol "__declspec(dllimport) public: static class vtkRenderWindow * __cdecl
> vtkRenderWindow::New            (void)"
> (__imp_?New at vtkRenderWindow at  at SAPAV1 at XZ) referenced in function _main
> 
>     But I did include VTK_LIBRARIES in my TARGET_LINK_LIBRARIES statement!
>     Is it necessary to use the individual libs instead of the VTK_LIBRARIES
> variable?
> 
>     Though, the include directories for vtk are set correctly.
> 
> Toon.
> 
> ----------------------------------------------------------------------------
> ---------------------------
> CMakeLists.txt:
> ----------------------------------------------------------------------------
> ---------------------------
> 
> PROJECT( THCochleaSegmentationII )
> 
> #
> #  FIND ITK
> #
> INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
> FIND_PACKAGE(ITK)
> IF (USE_ITK_FILE)
>   INCLUDE (${USE_ITK_FILE})
> ELSE (USE_ITK_FILE)
>   MESSAGE( FATAL_ERROR "This application requires ITK. One of these
> components is missing. Please verify configuration")
> ENDIF (USE_ITK_FILE)
> 
> 
> #
> # FIND VTK
> #
> INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
> FIND_PACKAGE(VTK)
> IF (USE_VTK_FILE)
>   INCLUDE (${USE_VTK_FILE})
> ELSE (USE_VTK_FILE)
>   MESSAGE( FATAL_ERROR "This application requires VTK. One of these
> components is missing. Please verify configuration")
> ENDIF (USE_VTK_FILE)
> 
> 
> 
> #
> # FIND FLTK
> #
> INCLUDE (${CMAKE_ROOT}/Modules/FindFLTK.cmake)
> FIND_PACKAGE(FLTK)
> IF (FLTK_FOUND)
>   INCLUDE_DIRECTORIES (${FLTK_INCLUDE_DIR} )
> ELSE (FLTK_FOUND)
>   MESSAGE( FATAL_ERROR "This application requires FLTK. One of these
> components is missing. Please verify configuration")
> ENDIF (FLTK_FOUND)
> 
> 
> #
> #  Additional include directories
> #
> INCLUDE_DIRECTORIES( ${THCochleaSegmentationII_SOURCE_DIR} )
> 
> #
> #  Define the list of source files
> #
> SET(APPLICATION_SOURCES THCochleaSegmentationII.cxx
> THCochleaSegmentationIIGUI.cxx)
> 
> #
> # The application
> #
> ADD_EXECUTABLE( THCochleaSegmentationII ${APPLICATION_SOURCES})
> 
> #
> # Link application to libraries
> #
> TARGET_LINK_LIBRARIES( THCochleaSegmentationII ${ITK_LIBRARIES}
> ${FLTK_LIBRARIES} ${VTK_LIBRARIES} )
> 
> #
> # Generate the GUI .cxx and .h files
> #
> FLTK_WRAP_UI(THCochleaSegmentationII THCochleaSegmentationIIGUI.fl)
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>