<div dir="ltr"><div><div>Hi all, I know this is a problem with cmake but maybe you can help me. I am using qt creator 2.4 and the code below. I am trying to use qt +itk+vtk. It builds ok but fails in the linking part. I have tried a complete day and dont know what else to do. I have commented and uncommented many parts of the file. I want to do the same as <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance</a><br>
<br>I attach a link to the error file (1.2 MB) <a href="https://www.dropbox.com/s/b8od7tywvlqn4um/building_error.txt">https://www.dropbox.com/s/b8od7tywvlqn4um/building_error.txt</a><br><br></div>Thank you very much<br><br>
</div>Ignacio<br><div><div><br>CMakeLists.txt:<br><br><br>cmake_minimum_required(VERSION 2.8)<br> project(ConnectedThresholdDriver)<br><br><br># Find ITK. <br><br><br>#SET(CMAKE_PREFIX_PATH /opt/itk5d/lib/cmake/ITK-4.5/)<br>
#SET(CMAKE_PREFIX_PATH /opt/itk/vtk5/debug8/lib/cmake/ITK-4.5/)<br>SET(CMAKE_PREFIX_PATH /opt/itk/vtk5/release3/lib/cmake/ITK-4.5/)<br>find_package(ITK REQUIRED)<br>include(${ITK_USE_FILE})<br>if (ITKVtkGlue_LOADED)<br> find_package(VTK REQUIRED)<br>
include(${VTK_USE_FILE})<br>endif()<br>if (DCMTK_LOADED)<br> find_package(DCMTK REQUIRED)<br> include(${DCMTK_USE_FILE})<br>endif()<br><br>#SET(CMAKE_PREFIX_PATH /opt/gdcmd)<br>#find_package(GDCM REQUIRED)<br>#include(${GDCM_USE_FILE})<br>
<br>#SET(ITK_LIBS ITKCommon ITKIOVTK ITKVTK ITKVtkGlue ITKIODCMTK ITKIOMeta)<br><br># Find VTK<br>#SET(CMAKE_PREFIX_PATH /opt/vtk5d/lib/cmake/vtk-5.10/)<br>#FIND_PACKAGE(VTK REQUIRED)<br>#INCLUDE(${VTK_USE_FILE})<br><br>
#SET(VTK_LIBS vtkRendering vtkCommon vtkIO vtkGraphics vtkHybrid vtkImaging)<br><br><br>#Find QT<br>find_package(Qt4 REQUIRED)<br>include(${QT_USE_FILE})<br><br><br>#INCLUDE_DIRECTORIES( ${QT_INCLUDES} ${ITK_INCLUDE_DIR} ${VTK_INCLUDE_DIR} ${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )<br>
<br>#SET(LINK_LIBRARIES ${ITK_LIBS} ${VTK_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} QVTK)<br><br>#LINK_DIRECTORIES(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_SOURCE_DIR})<br><br><br>set(SRC ConnectedThresholdDriver.cxx ConnectedThreshold.cxx ../ItkDCMTKImageIO.cxx ../ItkDCMTKFileReader.cxx ../ItkImageSeriesReader.cxx ../ItkDCMTKSeriesFileNames.cxx ../ItkDCMTKSeriesFileNames.h ../ItkDCMTKFileReader.h ../ItkImageSeriesReader.h ../ItkDCMTKImageIO.h )<br>
<br>set(MOC ConnectedThreshold.h )<br>set(UI ConnectedThreshold.ui )<br><br><br>qt4_wrap_cpp(MOC_GENERATED ${MOC})<br>qt4_wrap_ui(UI_GENERATED ${UI})<br><br>INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )<br>
#add_library(${UI_GENERATED})<br>add_executable(ConnectedThreshold ${SRC} ${MOC_GENERATED} ${UI_GENERATED} )<br><br><br>target_link_libraries(ConnectedThreshold ${ITK_LIBS} ${VTK_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} QVTK)# ${LINK_LIBRARIES} )<br>
<br clear="all"><div><br>-- <br>José Ignacio Prieto<br>celular(nuevo): 94348182
</div></div></div></div>