[vtkusers] CMakefile + QVTKWidget

Mike Rob mikerob2015 at gmail.com
Sun Nov 2 14:18:08 EST 2014


I wanted to add that if I take out the instant of the QVTKWidget from
the  mainwindow.ui,
then the code runs fine without the " glibc detected" and "core dumped"



On Sat, Nov 1, 2014 at 10:42 PM, Mike Rob <mikerob2015 at gmail.com> wrote:

> Hi,
>
> I have a simple example which has an instant of QVTKWidget. I can compile
> the code successfully using the following cmake file, but when I run the
> binary file, I get *** glibc detected *** core dumped....
>
> Here is my CMakeFile. Is there anything wrong in cmake?
>
> cmake_minimum_required(VERSION 2.8)
>
> PROJECT(HelloWorld)
>
> find_package(Qt5Widgets)
>
> 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()
>
> QT5_WRAP_UI(UISrcs mainwindow.ui)
> QT5_WRAP_CPP(MOCSrcs mainwindow.h)
>
> ADD_EXECUTABLE(MyProject HelloWorld.cpp mainwindow.cpp ${MOCSrcs}
> ${UISrcs})
>
> include_directories(${CMAKE_CURRENT_SOURCE_DIR}
> ${CMAKE_CURRENT_BINARY_DIR})
>
> qt5_use_modules(MyProject Widgets)
>
> target_link_libraries(MyProject  ${Glue}  ${VTK_LIBRARIES}
> ${ITK_LIBRARIES})
>
>
> Mike
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141102/d0759b2b/attachment.html>


More information about the vtkusers mailing list