<div dir="ltr">target_link_libraries(<div>ConnectedThreshold ${ITK_LIBS} ${VTK_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} QVTK)# ${LINK_LIBRARIES} )<br></div><div>should be<br>target_link_libraries(<div>ConnectedThreshold ${ITK_LIBRARIES} ${VTK_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} QVTK)# ${LINK_LIBRARIES} )<span class=""><font color="#888888"><br>
</font></span></div><br></div><div><span class=""><font color="#888888">
</font></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 20, 2013 at 10:28 AM, Jose Ignacio Prieto <span dir="ltr"><<a href="mailto:joseignacio.prieto@gmail.com" target="_blank">joseignacio.prieto@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">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" target="_blank">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} )<span class="HOEnZb"><font color="#888888"><br>
<br clear="all"><div><br>-- <br>José Ignacio Prieto<br>celular(nuevo): 94348182
</div></font></span></div></div></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>