[ITK-users] Brand new project with itk sentence with QtCreator, Qt5 and Cmake crashes

Marcos fotosentido at gmail.com
Fri Aug 14 15:29:08 EDT 2015


I tried so many things, and now I think it works...
without setting ITK_DIR in CMakeLists...
I added the ITK and VTK dlls to the PATH... I think I didn't reboot after
that.

I compared the ImageFileReader CMakeLists.txt example, and restored some
lines (about VTKITKGlue) I deleted.

If it helps to someone, my working CMakeLists.txt is now:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)


PROJECT (UtilityDICOM)


FIND_PACKAGE(Qt5Widgets REQUIRED)


SET(CMAKE_INCLUDE_CURRENT_DIR ON)

SET(CMAKE_AUTOMOC ON)


QT5_WRAP_UI(Cmake_form_hdr mainwindow.ui)

add_library(mainwindow mainwindow.cpp ${Cmake_form_hdr})

qt5_use_modules(mainwindow Widgets)



# ITK

FIND_PACKAGE(ITK REQUIRED)

INCLUDE(${ITK_USE_FILE})

if (ITKVtkGlue_LOADED)

  find_package(VTK REQUIRED)

  include(${VTK_USE_FILE})

else()

  find_package(ItkVtkGlue REQUIRED)

  include(${ItkVtkGlue_USE_FILE})

  set(Glue ItkVtkGlue)

endif()



ADD_EXECUTABLE(UtilityDICOM WIN32 main.cpp)

TARGET_LINK_LIBRARIES(UtilityDICOM mainwindow ${Glue} ${VTK_LIBRARIES}
${ITK_LIBRARIES})

QT5_USE_MODULES(UtilityDICOM Core Gui Widgets)


Now I can access even to VTK libraries... Finally I can start to develop
something.
I'm not sure what was happening, maybe the dlls in PATH and not rebooting
after adding them.

Thanks for your time. I appreciate it.



2015-08-14 20:08 GMT+02:00 Siavash Khallaghi <siavashk at ece.ubc.ca>:

> Marcos, if you  add
> <
> http://typecastexception.com/post/2014/12/07/Adding-and-Editing-PATH-Environment-Variables-in-Windows.aspx
> >
> the location of your dlls to the PATH environment variable, QtCreator will
> automatically find them for you. Installing ITK /should/ take care of that
> for you though. Did you try rebooting your PC before running Qt?
>
> Siavash
>
>
>
> --
> View this message in context:
> http://itk-users.7.n7.nabble.com/ITK-users-Brand-new-project-with-itk-sentence-with-QtCreator-Qt5-and-Cmake-crashes-tp36005p36009.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20150814/1d5f7b50/attachment.html>


More information about the Insight-users mailing list