<div dir="ltr">Hello All<br><br>I am trying to start testing an application i developed on Mac Os X 10.5. The application uses ITK,VTK and Qt.<br><br>The problem is that using the same CMakeLists.cmake it compiles and links perfectly in VC7 but it gives me the following error when i try to build it using XCode<br>
<br>ld: duplicate symbol itk::Image&lt;unsigned short, 3u&gt;::GetNameOfClass() constin /Developer/usr/GUI_ICPbin/GUI_ICP.build/Release/GUI_ICPHeaders.build/Objects-normal/i386/itkMeshTovtkUnstructuredGrid.o and /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 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>&nbsp;&nbsp;&nbsp; INCLUDE(${ITK_USE_FILE})<br>ELSE(ITK_FOUND)<br>&nbsp;&nbsp;&nbsp; MESSAGE(FATAL_ERROR<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;ITK not found. Please set ITK_DIR.&quot;)<br>ENDIF(ITK_FOUND)<br><br>FIND_PACKAGE(VTK)<br>IF(NOT VTK_DIR)<br>&nbsp; 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>&nbsp; INCLUDE(${QT_USE_FILE})<br>
ELSE(QT_USE_FILE)<br>&nbsp; SET(QT_LIBRARIES&nbsp;&nbsp; ${QT_QT_LIBRARY})<br>ENDIF(QT_USE_FILE)<br><br>SET (GUI_ICP<br>&nbsp; main.cxx<br>&nbsp; mainWin.cxx<br>&nbsp; matrixWidget.cxx<br>&nbsp; ParametersWidget.cxx<br>&nbsp; algorithmsWidget.cxx<br>&nbsp; RegistrationAlgorithms.cxx<br>
&nbsp; Utilities.cxx<br>&nbsp; ExtremalPoints.cxx<br>&nbsp; ResultsWidget.cxx<br>&nbsp; itkImageToVTKImageFilter.cxx<br>&nbsp; SurfRec.cxx<br>&nbsp; vtkPowerCrustSurfaceReconstruction.cxx<br>&nbsp; SliceManager.cxx<br>&nbsp; itkMeshTovtkUnstructuredGrid.cxx<br>
&nbsp; Bimg2itkmesh.cxx<br>)<br><br># Use the include path and library for Qt that is used by VTK.<br>INCLUDE_DIRECTORIES(<br>&nbsp; ${QT_INCLUDE_DIR}<br>&nbsp; ${CMAKE_CURRENT_BINARY_DIR}<br>&nbsp; ${CMAKE_CURRENT_SOURCE_DIR}<br>)<br><br>&nbsp;<br>
&nbsp; SET (GUI_ICPHeaders mainWin.h matrixWidget.h ParametersWidget.h algorithmsWidget.h ResultsWidget.h SliceManager.h)<br>&nbsp; QT4_WRAP_CPP(MOCSrcs ${GUI_ICPHeaders} )<br>&nbsp; ADD_DEFINITIONS(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)<br>
&nbsp; 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>&nbsp; QVTK<br>&nbsp; ${QT_LIBRARIES}<br>&nbsp; vtkRendering<br>&nbsp; vtkGraphics<br>
&nbsp; vtkIO<br>&nbsp; vtkCommon<br>&nbsp; vtkHybrid<br>&nbsp; vtkWidgets<br>&nbsp; ITKAlgorithms<br>&nbsp; ITKStatistics<br>&nbsp; ITKIO <br>&nbsp; ITKBasicFilters <br>&nbsp; ITKCommon<br>)<br><br>I am using Cmake 2.4.8 on my mac<br><br>Thank you in advance<br><br>
</div>