[Insight-users] Link error with ITK and VTK ...

Luis Ibanez luis.ibanez@kitware.com
Wed May 5 01:08:52 EDT 2004


Hi Sergio,

This conflict arises from the fact that the DICOMParser
library is distributed both with VTK and ITK.

The conflict has been solved in the CVS versions
of VTK and ITK by adding some symbol mangling.


Please use the CVS version of ITK.


Regards,


   Luis


--------------------
Sergio Andres wrote:
> Hi all,
> 
> Some days ago I sent a mail asking for help about some conflicts
> I got when I compiled my application using ITK 1.6 and VTK 4.2 libs.
> 
> I downloaded CVS code of VTK and I got no link errors...
> 
> But I get similar link errors when I use vtkDICOMImageReader (CVS code, 
> 2004-04-26) and ITK 1.6..
> 
> The messages are like these:
> -------------------------------------------------------------
> vtkDICOMParser.lib(DICOMAppHelper.obj) : error LNK2005: "public: virtual 
> void __thiscall DICOMAppHelper::PixelRepresentationCallback(class 
> DICOMParser *,unsigned short,unsigned short,enum 
> DICOMParser::VRTypes,unsigned char *,int)" (?PixelRepresentat
> ionCallback@DICOMAppHelper@@UAEXPAVDICOMParser@@GGW4VRTypes@2@PAEH@Z) 
> already defined in ITKDICOMParser.lib(DICOMAppHelper.obj)
> 
> vtkDICOMParser.lib(DICOMAppHelper.obj) : error LNK2005: "public: virtual 
> void __thiscall DICOMAppHelper::PhotometricInterpretationCallback(class 
> DICOMParser *,unsigned short,unsigned short,enum 
> DICOMParser::VRTypes,unsigned char *,int)" (?Photometri
> cInterpretationCallback@DICOMAppHelper@@UAEXPAVDICOMParser@@GGW4VRTypes@2@PAEH@Z) 
> already defined in ITKDICOMParser.lib(DICOMAppHelper.obj)
> -----------------------------------------------------------
> 
> My CMakeLists.txt contains the following lines:
> -----------------------------------------------------------
> 
> PROJECT (Prueba_ITK_VTK)
> 
> # -----------------------------
> # sources
> # -----------------------------
> SET(SRCS
>    ${Prueba_ITK_VTK_SOURCE_DIR}/Source/main.cpp
> )
> 
> #------------------------------------------------------------
> # Include directories:
> #------------------------------------------------------------
> 
> # ------------------------------------------
> #    ITK includes and libs directories
> # ------------------------------------------
> 
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
> INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
> MESSAGE(FATAL_ERROR Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
> 
> 
> # -----------------------------
> # VTK includes and libs directories
> # -----------------------------
> INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
> IF (USE_VTK_FILE)
>  INCLUDE(${USE_VTK_FILE})
> ENDIF (USE_VTK_FILE)
> 
> #------------------------------------------------------------
> # Libraries
> #------------------------------------------------------------
> 
> # ITK_LIBRARIES
> SET (ITK_LIBS       ITKCommon
>    ITKIO
> )
> 
> 
> # -----------------------------
> # VTK libs
> # -----------------------------
> SET (VTK_LIBS
>            vtkImaging
>            vtkIO
>            vtkCommon
> )
> 
> 
> LINK_LIBRARIES(${ITK_LIBS} ${VTK_LIBS} )
> 
> ADD_EXECUTABLE(Main ${SRCS})
> -----------------------------------------------------------
> 
> So, if you know how to avoid these errors, please let me know..
> Thanks!
> 
> Regards,
> Sergio
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 






More information about the Insight-users mailing list