[Insight-users] Cmake Linking Object Error: undefined reference

Abayiz abayiz at yahoo.com
Fri Nov 18 06:44:25 EST 2011


Hi all,

I am using ccmake to compile my itk code. But the compilation problem occurs while building a specific target for object file. Here is the error message from the screen: 

*******************Scanning dependencies of target VavSegment
[100%] Building CXX object CMakeFiles/VavSegment.dir/VavSegment.o
Linking CXX executable VavSegment
CMakeFiles/VavSegment.dir/VavSegment.o:(.rodata._ZTVN3itk38VavBoneSegmentationLevelSetImageFilterINS_5ImageIfLj3EEES2_fEE[vtable for itk::VavBoneSegmentationLevelSetImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u>, float>]+0x458): undefined reference to `itk::VavBoneSegmentationLevelSetImageFilter<itk::Image<float, 3u>, itk::Image<float, 3u>, float>::SetThirdAdvectionFunction(itk::Image<itk::FixedArray<float, 3u>, 3u>*)'
collect2: ld returned 1 exit status
make[2]: *** [VavSegment] Error 1
make[1]: *** [CMakeFiles/VavSegment.dir/all] Error 2
make: *** [all] Error 2
********************

My CMakeLists is as follows: 

****************
cmake_minimum_required(VERSION 2.4)

PROJECT( VavSegment )

FIND_PACKAGE(ITK)
  IF(ITK_FOUND)
    INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)

SET(CMAKE_BUILD_TYPE "Release")

ADD_EXECUTABLE( VavSegment VavSegment.cxx
VavBoneSegmentationLevelSetFunction.h
VavBoneSegmentationLevelSetFunction.txx
VavBoneSegmentationLevelSetImageFilter.h
VavBoneSegmentationLevelSetImageFilter.txx
 )

TARGET_LINK_LIBRARIES( VavSegment
               ITKIO ITKCommon ITKBasicFilters ITKStatistics ITKAlgorithms
            )
***************************

What could be the problem? Many thanks in advance! 
Regards,
Abayiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111118/57c58a42/attachment.htm>


More information about the Insight-users mailing list