[Insight-users] Bls: How to use ITK+VTK+QT in an application

Kishore Mosaliganti kishoreraom at gmail.com
Sun Mar 28 15:39:54 EDT 2010


Hi Sutrisno,

I wonder if you set the following variablees when compiling VTK.

VTK_USE_QT set to ON
VTK_USE_GUISUPPORT set to ON

Kishore

On Sun, Mar 28, 2010 at 2:10 AM, SUTRISNO SUTRISNO
<sutrisno_link at yahoo.com>wrote:

> Hi Luis,
>
> Thanks, I've successfully compiled qt with cmake.
> but when I use vtk ,  errors that occured like this :
>
> make[2]: *** No rule to make target `/usr/lib/libtiff.so', needed by
> `qtvtk'.  Stop.
> make[2]: Leaving directory `/home/sutrisno/project-sut/qtvtkcmake'
> make[1]: *** [CMakeFiles/qtvtk.dir/all] Error 2
> make[1]: Leaving directory `/home/sutrisno/project-sut/qtvtkcmake'
> make: *** [all] Error 2
> root at sutrisno-pc:~/project-sut/qtvtkcmake
>
>
> Regards,
>
>    Sutrisno
>
> ------------------------------
> *Dari:* Luis Ibanez <luis.ibanez at kitware.com>
> *Kepada:* SUTRISNO SUTRISNO <sutrisno_link at yahoo.com>
> *Cc:* itk <Insight-users at itk.org>
> *Terkirim:* Ming, 28 Maret, 2010 01:23:10
> *Judul:* How to use ITK+VTK+QT in an application
>
> Hi Sutirsno,
>
> Here is what you need in your CMakeLists.txt file
> in order to use ITK+VTK+Qt:
>
>
> FIND_PACKAGE(ITK  REQUIRED)
> INCLUDE(${ITK_USE_FILE})
>
> FIND_PACKAGE(VTK REQUIRED)
> INCLUDE(${VTK_USE_FILE})
>
> FIND_PACKAGE( Qt4  REQUIRED )
>
>
> INCLUDE_DIRECTORIES(
>   ${QT_INCLUDES}
>   ${VTK_INCLUDE_DIR}
>   ${QT_INCLUDE_DIR}
>   ${QT_QTGUI_INCLUDE_DIR}
>   ${QT_QTCORE_INCLUDE_DIR}
>   ${CMAKE_CURRENT_BINARY_DIR}
>   ${CMAKE_CURRENT_SOURCE_DIR}
>   )
>
> LINK_LIBRARIES (
>   ITKIO ITKStatistics ITKNumerics
>   ${QT_QTCORE_LIBRARY}
>   ${QT_QTGUI_LIBRARY}
>   vtkCommon
>   vtkRendering
>   vtkIO
>   vtkFiltering
>   vtkGraphics
>   vtkWidgets
>   vtkImaging
>   )
>
>
>
> Regards,
>
>
>       Luis
>
>
>
>
> ---------------------------------------------------------------------
> On Thu, Mar 25, 2010 at 9:35 PM, SUTRISNO SUTRISNO
> <sutrisno_link at yahoo.com> wrote:
> > Hi Luis,
> >
> > I've studied hard to configure my project with cmake
> > but I am still confused in writing CMakelists.txt
> >  Can you help me how to write CMakeList.txt?
> >
> > I tried it in stages
> > 1. Just qt
> > 2. qt + vtk
> > 3. vtk and qt + ITK
> >
> > I failed for the first step (qt only). I made a simple program and I
> tried
> > configured with cmake
> > my project directory:
> >  qtcmake /
> >                   - project.pro
> >                   - main.cpp
> >                   - form1.ui
> >                   - form1.ui.h
> >
> > my CMakeLists.txt :
> >
> >     cmake_minimum_required(VERSION 2.6)
> >     PROJECT(QtCmake)
> >     INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
> >     FIND_PACKAGE(Qt3 REQUIRED)
> >     INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR})
> >     LINK_LIBRARIES( ${QT_QT_LIBRARY})
> >     ADD_EXECUTABLE(QtCmake form1.ui.h form1.ui main.cpp  )
> >
> > But there were error :
> >
> > root at sutrisno-pc:~/project-sut/qtcmake# cmake .
> > -- Configuring done
> > -- Generating done
> > -- Build files have been written to: /home/sutrisno/project-sut/qtcmake
> > root at sutrisno-pc:~/project-sut/qtcmake# make
> > Scanning dependencies of target QtCmake
> > [100%] Building CXX object CMakeFiles/QtCmake.dir/main.cpp.o
> > /home/sutrisno/project-sut/qtcmake/main.cpp:2:19: error: form1.h: No such
> > file or directory
> > /home/sutrisno/project-sut/qtcmake/main.cpp: In function ‘int main(int,
> > char**)’:
> > /home/sutrisno/project-sut/qtcmake/main.cpp:7: error: ‘Form1’ was not
> > declared in this scope
> > /home/sutrisno/project-sut/qtcmake/main.cpp:7: error: expected `;' before
> > ‘w’
> > /home/sutrisno/project-sut/qtcmake/main.cpp:8: error: ‘w’ was not
> declared
> > in this scope
> > make[2]: *** [CMakeFiles/QtCmake.dir/main.cpp.o] Error 1
> > make[1]: *** [CMakeFiles/QtCmake.dir/all] Error 2
> > make: *** [all] Error 2
> > root at sutrisno-pc:~/project-sut/qtcmake#
> >
> >
> > Regards,
> >
> >       Sutrisno
> > ________________________________
>
> ------------------------------
>  Dapatkan alamat Email baru Anda!
> <http://sg.rd.yahoo.com/id/mail/domainchoice/mail/signature/*http://mail.promotions.yahoo.com/newdomains/id/>
> Dapatkan nama yang selalu Anda inginkan sebelum diambil orang lain!
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100328/652b7dae/attachment.htm>


More information about the Insight-users mailing list