[Insight-users] Help with "Undefined references during linking"

Martin Kavec kavec at messi.uku.fi
Tue Apr 4 05:25:57 EDT 2006


Hi,

I am writing a piece of IO code to read a FSL affine transform file. The 
transform is (always) stored in an ASCII file as a 4x4 matrix, so it is 
should not be a "rocket science" to read it.

My code is based on Code/IO/itkTransformFileREader.cxx, except that 
the ::Update() method will be different. I attached the header, 
implementation, CMakeList.txt and small test code to make it easier to 
compile.

The code compiles fine, but the linker complains about missing references 
to ::Update(), ::New() and ::Create() methods.

I tried to figure out what's wrong, but no luck, so I would appreciate a help. 
Thanks.

Martin
-------------- next part --------------
PROJECT( itkFSLAffineTransformFileReader )

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)

SET(CMAKE_VERBOSE_MAKEFILE ON)
ADD_DEFINITIONS(-Wall)

INCLUDE_REGULAR_EXPRESSION(".*")

ADD_EXECUTABLE(itkFSLAffineTransformFileReaderTest itkFSLAffineTransformFileReaderTest.cxx )
TARGET_LINK_LIBRARIES(itkFSLAffineTransformFileReaderTest ITKStatistics ITKCommon ITKNumerics ITKMetaIO ITKIO)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkFSLAffineTransformFileReader.cxx
Type: text/x-c++src
Size: 1141 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060404/e3976e13/itkFSLAffineTransformFileReader.cxx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkFSLAffineTransformFileReaderTest.cxx
Type: text/x-c++src
Size: 1033 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060404/e3976e13/itkFSLAffineTransformFileReaderTest.cxx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkFSLAffineTransformFileReader.h
Type: text/x-c++hdr
Size: 1877 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060404/e3976e13/itkFSLAffineTransformFileReader.hpp


More information about the Insight-users mailing list