[Insight-users] VTK_LIBRARIES empty?

Toon Huysmans denhuys at hotmail.com
Fri, 9 Apr 2004 17:02:04 +0200


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)