[Insight-users] ImageRegistration2.cxx Compilation Error : Actually a LINK error

Luis Ibanez luis.ibanez@kitware.com
Tue May 4 17:35:46 EDT 2004


Hi Nicolas,

GaussianKernelFunction is in the ITKCommon library.

Please add this library to the TARGET_LINK_LIBRARIES()
command in your CMakeLists.txt file.


Regards,


    Luis




------------------------
Taburet, Nicolas wrote:

> Dear ITK users
> 
> I am a beginer and I try to compile ImageRegistration2.cxx file but I get
> this message:
> 
> 
> Building executable
> /home/nico/itk/bin/Registration/ImageRegistration2.exe...
> ImageRegistration2.o(.text$_ZN3itk22GaussianKernelFunctionC1Ev+0x15):ImageRe
> gistration2.cxx: undefined reference to
> '__imp___ZTVN3itk14GaussianKernelFunctionE'
> ImageRegistration2.o(.text$_ZN3itk14KernelFunctionC1Ev+0x15):ImageRegistrati
> on2.cxx: undefined reference to '__imp___ZTVN3itk14KernelFunctionE'
> collect2: ld returned 1 exit status
> make[1]: ***[/home/nico/itk/bin/Registration/ImageRegistration2.exe] Error 1
> make: ***[default_target] Error 2
> 
> Here is my CMakeLists.txt file: 
> PROJECT(ImageRegistration2)
> INCLUDE_REGULAR_EXPRESSION("^.*$")
> 
> # Find ITK.
> 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)
> 
> ADD_EXECUTABLE(ImageRegistration2 ImageRegistration2.cxx )
> TARGET_LINK_LIBRARIES(ImageRegistration2 ITKNumerics ITKIO)
> 
> I think the error comes from itk::MutualInformationImageToImageMetric which
> use itk::KermelFunction and itk::GaussianKermelFunction but I haven't had
> any success solviing the problem. 
> Any assitance would be greatly appreciated.  
> Thanks. 
> Nicolas
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 






More information about the Insight-users mailing list