[Insight-users] Please help - Problems updating to ITK 2.4.1 from ITK 2.0.0

George Iordanescu giordanescu at cmr.nunet.net
Mon Feb 6 19:30:16 EST 2006


Hi everybody,

I was able to built ITK 2.4.1 and then I tried to recompile my
applications and I get the "undefined reference to
`itk::Statistics::DenseFrequencyContainer::DenseFrequencyContainer"
error message. 

One of my applications is a highly modified version of the
LandmarkInitializedMutualInformationRegistration example from ITK
applications. I am also attaching two cmake files to the message. 

Any suggestions will be highly appreciated.

Thx.
George
 

make messages:
....
Scanning dependencies of target DataManagement
Building CXX object
Auxiliary/DataManagement/CMakeFiles/DataManagement.dir/DataManager.o
Building CXX object
Auxiliary/DataManagement/CMakeFiles/DataManagement.dir/MetaHeaderCreator.o
Building CXX object
Auxiliary/DataManagement/CMakeFiles/DataManagement.dir/complexFieldReader.o
Building CXX object
Auxiliary/DataManagement/CMakeFiles/DataManagement.dir/fieldReader.o
Linking CXX static library libDataManagement.a
Generating guiMain.cxx
Scanning dependencies of target
LandmarkInitializedMutualInformationRegistration
Building CXX object
LandmarkInitializedMutualInformationRegistration/CMakeFiles/LandmarkInitializedMutualInformationRegistration.dir/guiMainImplementation.o
/home/giordanescu/cmr/apps/ITKApp/LandmarkInitializedMutualInformationRegistration/guiMainImplementation.cxx: In
   member function `void
guiMainImplementation::Register_PerVolume(int)':
/home/giordanescu/cmr/apps/ITKApp/LandmarkInitializedMutualInformationRegistration/guiMainImplementation.cxx:1713: warning: decimal
   constant is so large that it is unsigned
Building CXX object
LandmarkInitializedMutualInformationRegistration/CMakeFiles/LandmarkInitializedMutualInformationRegistration.dir/LandmarkRegistrator.o
Building CXX object
LandmarkInitializedMutualInformationRegistration/CMakeFiles/LandmarkInitializedMutualInformationRegistration.dir/main.o
Building CXX object
LandmarkInitializedMutualInformationRegistration/CMakeFiles/LandmarkInitializedMutualInformationRegistration.dir/CommandIterationUpdate.o
Building CXX object
LandmarkInitializedMutualInformationRegistration/CMakeFiles/LandmarkInitializedMutualInformationRegistration.dir/guiMain.o
Linking CXX executable LandmarkInitializedMutualInformationRegistration
/home/giordanescu/cmr/apps/ITKApp/builds/buildtest/Auxiliary/DataManagement/libDataManagement.a(DataManager.o)(.gnu.linkonce.t._ZN3itk10Statistics23DenseFrequencyContainer3NewEv+0x7f): In function `itk::Statistics::DenseFrequencyContainer::New()':
: undefined reference to
`itk::Statistics::DenseFrequencyContainer::DenseFrequencyContainer()'
/home/giordanescu/cmr/apps/ITKApp/builds/buildtest/Auxiliary/DataManagement/libDataManagement.a(DataManager.o)(.gnu.linkonce.t._ZNK3itk10Statistics9HistogramIdLj2ENS0_23DenseFrequencyContainerEE12GetFrequencyERKm+0x1f): In function `itk::Statistics::Histogram<double, 2u, itk::Statistics::DenseFrequencyContainer>::GetFrequency(unsigned long const&) const':
: undefined reference to
`itk::Statistics::DenseFrequencyContainer::GetFrequency(unsigned long)
const'
/home/giordanescu/cmr/apps/ITKApp/builds/buildtest/Auxiliary/DataManagement/libDataManagement.a(DataManager.o)(.gnu.linkonce.t._ZN3itk10Statistics9HistogramIdLj2ENS0_23DenseFrequencyContainerEE10InitializeERKNS_4SizeILj2EEE+0x14d): In function `itk::Statistics::Histogram<double, 2u, itk::Statistics::DenseFrequencyContainer>::Initialize(itk::Size<2u> const&)':
: undefined reference to
`itk::Statistics::DenseFrequencyContainer::Initialize(unsigned long)'
/home/giordanescu/cmr/apps/ITKApp/builds/buildtest/Auxiliary/DataManagement/libDataManagement.a(DataManager.o)(.gnu.linkonce.t._ZN3itk10Statistics9HistogramIdLj2ENS0_23DenseFrequencyContainerEE17IncreaseFrequencyERKmf+0x22): In function `itk::Statistics::Histogram<double, 2u, itk::Statistics::DenseFrequencyContainer>::IncreaseFrequency(unsigned long const&, float)':
....

-- 
George Iordanescu, Ph.D.
Associate Researcher
Center for Basic MR Research
1033 University Place, Suite 100
Evanston, IL 60201
Phone: (224) 364-1410
Fax: (847) 492-0731
Email: giordanescu at cmr.nunet.net
-------------- next part --------------
CMAKE_MINIMUM_REQUIRED(VERSION 1.6)
PROJECT(ITKApp)
INCLUDE_REGULAR_EXPRESSION("^.*$")

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

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

SET(CMRR_APPS_SOURCE_DIR /home/giordanescu/cmr/apps/ITKApp)
CONFIGURE_FILE(${CMRR_APPS_SOURCE_DIR}/LandmarkInitializedMutualInformationRegistration/Fem/FiniteElementRegistrationParameters1.txt
               Accessory/CMRReg_FiniteElementRegistrationParameters1.txt COPYONLY)

CONFIGURE_FILE(${CMRR_APPS_SOURCE_DIR}/NeuronalTractDetection/Fem/FiniteElementRegistrationParameters1.txt
               Accessory/NeuronalTractDetection_FiniteElementRegistrationParameters1.txt COPYONLY)

CONFIGURE_FILE(${CMRR_APPS_SOURCE_DIR}/NeuronalTractDetection/Accessory/NeuronalTractDetection_SegmentationSeeds.txt
               Accessory/NeuronalTractDetection_SegmentationSeeds.txt COPYONLY)

CONFIGURE_FILE(${CMRR_APPS_SOURCE_DIR}/NeuronalTractDetection/Accessory/TemplateNeuronalTractDetection_SegmentationSeeds.txt
               Accessory/TemplateNeuronalTractDetection_SegmentationSeeds.txt COPYONLY)

CONFIGURE_FILE(${CMRR_APPS_SOURCE_DIR}/NeuronalTractDetection/Accessory/TemplateNeuronalTractDetection_SegmentationSeeds.txt
               output/FMRIDataSimulation/df/Delete_This_File_It_was_copied_only_to_create_its_directory.txt COPYONLY)
CONFIGURE_FILE(${CMRR_APPS_SOURCE_DIR}/NeuronalTractDetection/Accessory/TemplateNeuronalTractDetection_SegmentationSeeds.txt
               output/FMRIDataSimulation/activation/Delete_This_File_It_was_copied_only_to_create_its_directory.txt COPYONLY)


# 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)

# use CMRR settings on hp4000
SET(CMRR_SOURCE_DIR /home/giordanescu/cmr/apps/CMake/MyCMakeModules)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMRR_SOURCE_DIR})
FIND_PACKAGE(CMRR)

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)

    # If VTK was built using Patented, add an option for using patented code
    # in InsightApplications (SNAP in particular)
    IF(VTK_USE_PATENTED)
      OPTION(USE_VTK_PATENTED "Use VTK Patented Libraries (optional)" OFF)
      MARK_AS_ADVANCED(USE_VTK_PATENTED)
      IF(USE_VTK_PATENTED)
        ADD_DEFINITIONS(-DUSE_VTK_PATENTED)
      ENDIF(USE_VTK_PATENTED)
    ENDIF(VTK_USE_PATENTED)
    
  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)" ON)
IF(USE_FLTK)
  FIND_PACKAGE(FLTK)
  IF(FLTK_FOUND)
    INCLUDE_DIRECTORIES(${FLTK_INCLUDE_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(ADD_GUI_EXECUTABLE name sources)
    ADD_EXECUTABLE(${name} ${sources})
ENDMACRO(ADD_GUI_EXECUTABLE)

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

IF(WIN32)
  ADD_DEFINITIONS(-DWIN32)
ENDIF(WIN32)
SUBDIRS(LandmarkInitializedMutualInformationRegistration)
SUBDIRS(NeuronalTractDetection)
SUBDIRS(FMRIDataSimulation)

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)









-------------- next part --------------
#
# Find all cmrr dependencies
#

#Find ITK
SET(ITK_DIR /home/giordanescu/itk/build)
SET(ITK_SOURCE_DIR /home/giordanescu/itk/InsightToolkit-2.4.1)
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)

# Find VTK
OPTION(USE_VTK "Use VTK (The Visualization Toolkit) (some applications need this)" ON)
IF(USE_VTK)
	SET(VTK_DIR /home/giordanescu/vtk/build)
	FIND_PACKAGE(VTK)
	IF(VTK_FOUND)
	  INCLUDE(${USE_VTK_FILE})
	 ELSE(VTK_FOUND)
	   MESSAGE(FATAL_ERROR
	           "Cannot build without VTK.  Please set VTK_DIR.")
	ENDIF(VTK_FOUND)
ENDIF(USE_VTK)

#Find FLTK
SET(FLTK_INCLUDE_DIR /home/giordanescu/fltk/fltk-1.1.4)
#SET(FLTK_BASE_LIBRARY ${FLTK_INCLUDE_DIR}/lib/libfltk.a)
#SET(FLTK_FLUID_EXECUTABLE ${FLTK_INCLUDE_DIR}/fluid/fluid)
#SET(FLTK_FORMS_LIBRARY ${FLTK_INCLUDE_DIR}/lib/libfltk_forms.a)
#SET(FLTK_IMAGES_LIBRARY ${FLTK_INCLUDE_DIR}/lib/libfltk_images.a)
#SET(FLTK_GL_LIBRARY ${FLTK_INCLUDE_DIR}/lib/libfltk_gl.a)

SET(CMR_AUXILIARY /home/giordanescu/cmr/apps/ITKApp/Auxiliary)


More information about the Insight-users mailing list