<div dir="ltr"><pre>Hello All<br><br>I am trying to start testing an application i developed on Mac Os X 10.5.<br>The application uses ITK3.6,VTK5 and Qt4.4.<br><br>The problem is that using the same CMakeLists.cmake it compiles and links<br>
perfectly in VC7 but it gives me the following error when i try to build it<br>using XCode<br><br>ld: duplicate symbol itk::Image&lt;unsigned short, 3u&gt;::GetNameOfClass()<br>constin<br>/Developer/usr/GUI_ICPbin/GUI_ICP.build/Release/GUI_ICPHeaders.build/Objects-normal/i386/itkMeshTovtkUnstructuredGrid.o<br>
and<br>/Developer/usr/GUI_ICPbin/GUI_ICP.build/Release/GUI_ICPHeaders.build/Objects-normal/i386/mainWin.o<br><br>I am not so experienced in the linking part of the process so i would really<br>apprecitae some help about this issue.<br>
<br>The CMakeLists.cmake i successfully use to build in VC7 is:<br><br>PROJECT(GUI_ICP)<br><br>FIND_PACKAGE(ITK)<br>IF(ITK_FOUND)<br>    INCLUDE(${ITK_USE_FILE})<br>ELSE(ITK_FOUND)<br>    MESSAGE(FATAL_ERROR<br>        &quot;ITK not found. Please set ITK_DIR.&quot;)<br>
ENDIF(ITK_FOUND)<br><br>FIND_PACKAGE(VTK)<br>IF(NOT VTK_DIR)<br>  MESSAGE(FATAL_ERROR &quot;Please set VTK_DIR.&quot;)<br>ENDIF(NOT VTK_DIR)<br>INCLUDE(${VTK_USE_FILE})<br><br># use what QVTK built with<br>SET(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH &quot;&quot;)<br>
SET(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH &quot;&quot;)<br>SET(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH &quot;&quot;)<br>SET(DESIRED_QT_VERSION ${VTK_DESIRED_QT_VERSION} CACHE FILEPATH &quot;&quot;)<br>
FIND_PACKAGE(Qt)<br>IF(QT_USE_FILE)<br>  INCLUDE(${QT_USE_FILE})<br>ELSE(QT_USE_FILE)<br>  SET(QT_LIBRARIES   ${QT_QT_LIBRARY})<br>ENDIF(QT_USE_FILE)<br><br>SET (GUI_ICP<br>  main.cxx<br>  mainWin.cxx<br>  matrixWidget.cxx<br>
  ParametersWidget.cxx<br>  algorithmsWidget.cxx<br>  RegistrationAlgorithms.cxx<br>  Utilities.cxx<br>  ExtremalPoints.cxx<br>  ResultsWidget.cxx<br>  itkImageToVTKImageFilter.cxx<br>  SurfRec.cxx<br>  vtkPowerCrustSurfaceReconstruction.cxx<br>
  SliceManager.cxx<br>  itkMeshTovtkUnstructuredGrid.cxx<br>  Bimg2itkmesh.cxx<br>)<br><br># Use the include path and library for Qt that is used by VTK.<br>INCLUDE_DIRECTORIES(<br>  ${QT_INCLUDE_DIR}<br>  ${CMAKE_CURRENT_BINARY_DIR}<br>
  ${CMAKE_CURRENT_SOURCE_DIR}<br>)<br><br><br>  SET (GUI_ICPHeaders mainWin.h matrixWidget.h ParametersWidget.h<br>algorithmsWidget.h ResultsWidget.h SliceManager.h)<br>  QT4_WRAP_CPP(MOCSrcs ${GUI_ICPHeaders} )<br>  ADD_DEFINITIONS(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)<br>
  SET_SOURCE_FILES_PROPERTIES(${GUI_ICP} PROPERTIES)<br><br><br>ADD_EXECUTABLE( GUI_ICP MACOSX_BUNDLE ${GUI_ICP} ${MOCSrcs})<br><br>TARGET_LINK_LIBRARIES( GUI_ICP<br>  QVTK<br>  ${QT_LIBRARIES}<br>  vtkRendering<br>  vtkGraphics<br>
  vtkIO<br>  vtkCommon<br>  vtkHybrid<br>  vtkWidgets<br>  ITKAlgorithms<br>  ITKStatistics<br>  ITKIO<br>  ITKBasicFilters<br>  ITKCommon<br>)<br><br>I am using Cmake 2.4.8 on my mac</pre>
</div>