[Insight-users] Problem of Build the ITK application

yingli fan yf34 at drexel.edu
Wed Feb 23 09:22:21 EST 2005


Hi All,

I try to build the application of ITK , what I did : I install the ITK VTK &
FLTK and did the cmake.

My computer is MAC

When I do the make under the binary folder of Application.

I list the error and my cmakelist file.

Thanks a lot 

yingli



here is the error
ld: Undefined symbols:
_fl_display
make[5]: *** 
[/Applications/ITK_VTK/ITK/InsightApplication_binary/SegmentationEditorFltkG
ui/EditorFltkGui/EditorFltkGui] Error 1
make[4]: *** [default_target] Error 2
make[3]: *** [default_target_EditorFltkGui] Error 2
make[2]: *** [default_target] Error 2
make[1]: *** [default_target_SegmentationEditorFltkGui] Error 2
make: *** [default_target] Error 2

Here is my cmakelist.txt file
 




CMAKE_MINIMUM_REQUIRED(VERSION 1.6)
PROJECT(InsightApplications)
INCLUDE_REGULAR_EXPRESSION("^.*$")

# Tell CMake's FIND_PACKAGE command where to look for our Find<pkg>
# modules.
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${InsightApplications_SOURCE_DIR})

IF(NOT WIN32)
  OPTION(BUILD_SHARED_LIBS "Build Insight-Applications with shared
libraries." OFF)
ENDIF(NOT WIN32)

# Don't build anything unless the version of CMake is high enough.
# The matching ELSE/ENDIF should be the last lines in the file.
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.5)

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

#---------------------------------------------------------------------------
--
# Configure Dart testing support.
INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
MARK_AS_ADVANCED(TCL_TCLSH)
IF(BUILD_TESTING)
  ENABLE_TESTING()
ENDIF(BUILD_TESTING)

# Determine what packages are available
# Add an option to use or not use VTK
OPTION(USE_VTK "Use VTK (The Visualization Toolkit) (some applications need
this)" OFF)
IF(USE_VTK)
  FIND_PACKAGE(VTK)
  IF (VTK_FOUND)
    INCLUDE (${VTK_USE_FILE})
 

    # Test for VTK using std libs
    IF(NOT VTK_USE_ANSI_STDLIB)
      MESSAGE("Warning.  Your VTK was not built with the VTK_USE_ANSI_STDLIB
"
              "option ON.  Link errors may occur.  Consider re-building VTK
"
              "with this option ON.  For MSVC 6, you MUST turn on the VTK "
              "option.  ITK will not link otherwise.")
    ENDIF(NOT VTK_USE_ANSI_STDLIB)

    # Test for VTK building Hybrid
    IF(NOT VTK_USE_HYBRID)
      MESSAGE("Your VTK was not built with the VTK_USE_HYBRID option ON.  "
              "Please reconfigure and recompile VTK with this option before
"
              "trying to use it with ITK.")
      SET(VTK_FOUND 0)
    ENDIF(NOT VTK_USE_HYBRID)
  ELSE(VTK_FOUND)
     MESSAGE(FATAL_ERROR
          "Cannot build InsightApplications without VTK.  Please set
VTK_DIR.")
  ENDIF(VTK_FOUND)

 
ENDIF(USE_VTK)

# Look for OpenGL.
FIND_PACKAGE(OpenGL)

IF(OPENGL_INCLUDE_PATH)
  INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_PATH})
ENDIF(OPENGL_INCLUDE_PATH)

# Add an option to use or not use FLTK (http://www.fltk.org)
OPTION(USE_FLTK "Use FLTK (The Fast Light Toolkit) for GUI (some
applications need this)" OFF)
IF(USE_FLTK)
  FIND_PACKAGE(FLTK)
  IF(FLTK_FOUND)
    INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})
  ELSE(FLTK_FOUND)
     MESSAGE(FATAL_ERROR
          "Cannot build InsightApplications without FLTK.  Please set
FLTK_DIR.")
 
  ENDIF(FLTK_FOUND)
ENDIF(USE_FLTK)

# The fluid-generated fltk sources have many warnings.  This macro
# will disable warnings for the generated files on some compilers.
MACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS files)
  IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.6)
    IF(CMAKE_COMPILER_IS_GNUCXX)
      FOREACH(f ${files})
        STRING(REGEX REPLACE "\\.fl$" ".cxx" SRC "${f}")
        STRING(REGEX REPLACE ".*/([^/]*)$" "\\1" SRC "${SRC}")
        SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS -w)
      ENDFOREACH(f)
    ENDIF(CMAKE_COMPILER_IS_GNUCXX)
  ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.6)
ENDMACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS)

# Macro for adding resources to GUI application on the Mac
#
IF(APPLE)
  FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)
  FIND_FILE(ITK_FLTK_RESOURCE mac.r /usr/local/include/FL)
  IF(NOT ITK_FLTK_RESOURCE)
    MESSAGE("Fltk resources not found, GUI application will not respond to
mouse events")
  ENDIF(NOT ITK_FLTK_RESOURCE)

  MACRO(ADD_GUI_EXECUTABLE name sources)
    ADD_EXECUTABLE(${name} ${sources})
    SET(EXEC_PATH ${EXECUTABLE_OUTPUT_PATH})
    IF(NOT EXEC_PATH)
      SET(EXEC_PATH ${CMAKE_CURRENT_BINARY_DIR})
    ENDIF(NOT EXEC_PATH)
      IF(ITK_APPLE_RESOURCE)
        ADD_CUSTOM_COMMAND(SOURCE ${name}
                           COMMAND ${ITK_APPLE_RESOURCE}
                           ARGS -t APPL ${ITK_FLTK_RESOURCE} -o
                           ${EXEC_PATH}/${name}
                           TARGET ${name})
      ENDIF(ITK_APPLE_RESOURCE)
  ENDMACRO(ADD_GUI_EXECUTABLE)
ELSE(APPLE)
  MACRO(ADD_GUI_EXECUTABLE name sources)
    ADD_EXECUTABLE(${name} ${sources})
  ENDMACRO(ADD_GUI_EXECUTABLE)
ENDIF(APPLE)

#

#Build the Auxiliary directory on which many applications depend
SUBDIRS(Auxiliary)

#Build the example of how to do simple scalar anisotropic diffusion
#on a PNG image
SUBDIRS (AnisotropicDiffusionImageFilter)

#Build the example of various methods of segmentation using level sets.
SUBDIRS (LevelSetSegmentation)

#Build the example of how to create a static library for
# select filters in itk.
SUBDIRS (ITKFilterLib)

#Build the example of how to create a static library for
# the multi-resolution mutual information registration framework in itk.
SUBDIRS (ITKRegistrationLib)

#Build the parameter file parser necessary for several applications that
follow
SUBDIRS(StreamedWatershedSegmentation/ParameterFileParser)

# Build the StreamedWatershedSegmentation example
#SUBDIRS(StreamedWatershedSegmentation)

# Build the AntiAliasBinaryImageFilter example
SUBDIRS(AntiAliasBinaryImageFilter)

# Build the SimpleLevelSetsExample
SUBDIRS(SimpleLevelSetsExample)

# Build the FloodFilledSpatialFunctionExample
SUBDIRS(FloodFilledSpatialFunction)

# Build the Multiresolution Registration example
SUBDIRS(MultiResMIRegistration)

# Build the MI Validation application
SUBDIRS(MIValidation)

# Build the IBSR Validation applications
SUBDIRS(IBSRValidation)

# Build the multichannel tissue classification validation
SUBDIRS(MultichannelTissueClassificationValidation)

# Build the DICOMApp example to output raw and png versions of DICOM file
SUBDIRS(DICOMApp)

#Build the examples of various fourth-order level set PDEs
SUBDIRS (LevelSetSurfaceProcessing)

# Applications requiring MetaImages and Fltk GUI
IF(FLTK_FOUND)
  IF(WIN32)
    ADD_DEFINITIONS(-DWIN32)
  ENDIF(WIN32)
  SUBDIRS(DistanceMapFilter)
  SUBDIRS(DicomImageViewer)
  SUBDIRS(GaussianFilter)
  SUBDIRS(Curves2DExtractor)
  SUBDIRS(Morphogenesis)
  SUBDIRS(MutualInformationEuler2DRegistration)
  SUBDIRS(ImageRegistration)
  SUBDIRS(ImageRegistration2D)
  SUBDIRS(LandmarkInitializedMutualInformationRegistration)
  SUBDIRS(RawImageReaderViewer)
  SUBDIRS(VoronoiSegmentation)
  SUBDIRS(SimpleFuzzyConnectedness)
  SUBDIRS(ThresholdSegmentationLevelSetFltkGui)
  IF(VTK_FOUND)
    SUBDIRS(RegionGrowingSegmentation)
    SUBDIRS(ThresholdSegmentationLevelSet)
    SUBDIRS(FastMarchingLevelSet)
    SUBDIRS(ShapeDetectionLevelSet)
    SUBDIRS(GeodesicActiveContour)
    SUBDIRS(SegmentationEditorFltkGui)
    SUBDIRS(SNAP)
  ENDIF(VTK_FOUND)
  SUBDIRS(ImageViewer)
  SUBDIRS(ImageColorViewer)
ENDIF(FLTK_FOUND)

# MetaImage Utilities
SUBDIRS(MetaImageImporter)
SUBDIRS(MetaImageReadWrite)

# Test the conditions for building the MRIBiasCorrection example
SUBDIRS(MRIBiasCorrection)

# Add an option to build FEM applications
SUBDIRS(FEM)

# Add an option to build or not build the FuzzyConnectedness example
SUBDIRS(FuzzyConnectedness)

# Add an option to build or not build the
# GaussianMinimumErrorClassifier example
SUBDIRS(GaussianMinimumErrorClassifier)

# Add an option to build or not build the
EllipsoidInteriorExteriorSpatialFunction example
SUBDIRS(EllipsoidInteriorExteriorSpatialFunction)

# Add an option to build or not build the
SymmetricEllipsoidInteriorExteriorSpatialFunction example
SUBDIRS(SymmetricEllipsoidInteriorExteriorSpatialFunction)

# Test the conditions for building the ThinPlateSplines example
IF(VTK_FOUND)
  IF(FLTK_FOUND)
    SUBDIRS(ThinPlateSplines)
  ENDIF(FLTK_FOUND)

  IF(VTK_WRAP_TCL)
    SUBDIRS(MRIRegistration vtkITK SegmentationEditor)
  ENDIF(VTK_WRAP_TCL)
  
  SET (VTK_AND_ITK_WRAPPED 0)
  IF(VTK_WRAP_PYTHON AND ITK_CSWIG_PYTHON)
    SET(VTK_AND_ITK_WRAPPED 1)
  ENDIF(VTK_WRAP_PYTHON AND ITK_CSWIG_PYTHON)
  IF(VTK_WRAP_TCL AND ITK_CSWIG_TCL)
    SET(VTK_AND_ITK_WRAPPED 1)
  ENDIF(VTK_WRAP_TCL AND ITK_CSWIG_TCL)
  
  IF(VTK_AND_ITK_WRAPPED)
    SUBDIRS(ConnectVTKITK)
  ENDIF(VTK_AND_ITK_WRAPPED)
  
ENDIF(VTK_FOUND)

LINK_LIBRARIES (
ITKAlgorithms
ITKCommon
ITKBasicFilters 
)

# If the version of CMake was too old, complain and build nothing.
# These should be the last lines in this file.
ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.5)
  MESSAGE(SEND_ERROR
          "This version of CMake is too old to build InsightApplications.  "
          "Please upgrade to CMake 1.6.")
ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.5)

*******************************************************
Yingli Fan
Laboratory for Bioimaging and Anatomical Informatics
Department of Neurobiology & Anatomy
Drexel University, College of Medicine
2900 Queen Lane PA 19129
Tel: 215-9918455 Fax: 215-843-9367
Email: Yingli.Fan at drexel.edu
*******************************************************


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050223/28340a9a/attachment.htm


More information about the Insight-users mailing list