[Insight-users] QtITK Problem

Julien Jomier jjomier at cs.unc.edu
Wed Nov 16 14:54:04 EST 2005


Hi Gheorghe,

What version of Qt are you using? This example works only with Qt 2.3

Let us know,

Julien

Gheorghe Postelnicu wrote:
> Hi Julien,
> 
> Thanks alot for the help!
> 
> Now I seem to have some linking problems. I should mention that I am 
> using ccmake version 2.2-patch 2 and I receive the following errors:
> 
> --
> Linking CXX executable QtITK
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorD1Ev+0x13): 
> In function `itk::QtLightIndicator::~QtLightIndicator()':
> : undefined reference to `vtable for itk::QtLightIndicator'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorD1Ev+0x1f): 
> In function `itk::QtLightIndicator::~QtLightIndicator()':
> : undefined reference to `vtable for itk::QtLightIndicator'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk12QtTranslatorD2Ev+0xb): 
> In function `itk::QtTranslator::~QtTranslator()':
> : undefined reference to `vtable for itk::QtTranslator'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk15QtSignalAdaptor10EmitSignalEv+0xd): 
> In function `itk::QtSignalAdaptor::EmitSignal()':
> : undefined reference to `itk::QtTranslator::Signal()'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk12QtTranslatorC2Ev+0x1d): 
> In function `itk::QtTranslator::QtTranslator()':
> : undefined reference to `vtable for itk::QtTranslator'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorC1EP7QWidgetPc+0x1e): 
> In function `itk::QtLightIndicator::QtLightIndicator(QWidget*, char*)':
> : undefined reference to `vtable for itk::QtLightIndicator'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorC1EP7QWidgetPc+0x2a): 
> In function `itk::QtLightIndicator::QtLightIndicator(QWidget*, char*)':
> : undefined reference to `vtable for itk::QtLightIndicator'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0xc): 
> undefined reference to `itk::QtTranslator::className() const'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x10): 
> undefined reference to `itk::QtTranslator::qt_cast(char const*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x14): 
> undefined reference to `itk::QtTranslator::qt_invoke(int, QUObject*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x18): 
> undefined reference to `itk::QtTranslator::qt_emit(int, QUObject*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x1c): 
> undefined reference to `itk::QtTranslator::qt_property(int, int, QVariant*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0xc): 
> undefined reference to `itk::QtTranslator::className() const'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x10): 
> undefined reference to `itk::QtTranslator::qt_cast(char const*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x14): 
> undefined reference to `itk::QtTranslator::qt_invoke(int, QUObject*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x18): 
> undefined reference to `itk::QtTranslator::qt_emit(int, QUObject*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x1c): 
> undefined reference to `itk::QtTranslator::qt_property(int, int, QVariant*)'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZNK3itk12QtTranslator10metaObjectEv+0x7): 
> In function `itk::QtTranslator::metaObject() const':
> : undefined reference to `itk::QtTranslator::staticMetaObject()'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTIN3itk15QtSignalAdaptorE+0x8): 
> undefined reference to `typeinfo for itk::QtTranslator'
> CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTIN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x8): 
> undefined reference to `typeinfo for itk::QtTranslator'
> collect2: ld returned 1 exit status
> make[2]: *** [QtITK] Error 1
> make[1]: *** [CMakeFiles/QtITK.dir/all] Error 2
> make: *** [all] Error 2
> 
> --
> 
> I have seen you mention that this was a known problem with CMake 2.0.2 
> not wrapping cpp for Qt, so I uncommented the relevant lines. So now my 
> CMakeLists.txt looks like this:
> 
> --
> PROJECT(QtITKExample)
> 
> #IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
> 
>   FIND_PACKAGE(ITK)
>   IF(ITK_FOUND)
>     INCLUDE(${ITK_USE_FILE})
>   ELSE(ITK_FOUND)
>     MESSAGE(FATAL_ERROR
>             "Cannot build InsightApplications without ITK.  Please set 
> ITK_DIR.")
>   ENDIF(ITK_FOUND)
> 
> #ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
> 
> #
> # Find QT
> #
> INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
> 
> INCLUDE_DIRECTORIES(
> ${QT_INCLUDE_DIR}
> ${QT_INCLUDE_PATH}
> )
> 
> LINK_LIBRARIES (
> ITKIO
> ITKCommon
> ITKBasicFilters
> ITKAlgorithms
> ITKIO
> itkpng
> itkzlib
> ${QT_QT_LIBRARY}
> )
> 
> SET(QtITK_SRCS
> itkQtProgressBar.cxx
> qtITK.cxx
> )
> 
> SET(QtITK_MOC_SRCS
> itkQtAdaptor.h
> itkQtLightIndicator.h
> )
> 
> #IF(QT_WRAP_CPP)
> #  QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)
> #ENDIF(QT_WRAP_CPP)
> 
> QT_WRAP_CPP(QtITK ${QtITK_SRCS} ${QtITK_MOC_SRCS})
> ADD_EXECUTABLE(QtITK ${QtITK_SRCS})
> 
> #ADD_EXECUTABLE(QtITK QtITK_SRCS)
> 
> #INSTALL_TARGETS(/bin QtITK)
> --
> 
> Thanks for the help,
> 
> On 11/16/05, *Julien Jomier* <jjomier at cs.unc.edu 
> <mailto:jjomier at cs.unc.edu>> wrote:
> 
>     Hi Gheorghe,
> 
>     Try to replace
> 
>     QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)
>     ADD_EXECUTABLE(QtITK QtITK_SRCS)
> 
>     by
> 
>     QT_WRAP_CPP(QtITK ${QtITK_SRCS} ${QtITK_MOC_SRCS})
>     ADD_EXECUTABLE(QtITK ${QtITK_SRCS})
> 
>     Let us know if that works or not. I'll put a fix as soon as I can.
> 
>     Thanks for the report,
> 
>     Julien
> 
>     Gheorghe Postelnicu wrote:
>      > Hi,
>      >
>      > I have a problem when building the provided qtITK example. Namely, I
>      > receive the message
>      >
>      > CMake Error: can not find file
>     /local/ghighi/code/workshop/itkqt/QtITK_SRCS
>      >
>      > when running ccmake .
>      >
>      > Here is my CMakeLists.txt file:
>      >
>      > --
>      > PROJECT(QtITKExample)
>      >
>      > IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
>      >
>      >   FIND_PACKAGE(ITK)
>      >   IF(ITK_FOUND)
>      >     INCLUDE(${ITK_USE_FILE})
>      >   ELSE(ITK_FOUND)
>      >     MESSAGE(FATAL_ERROR
>      >             "Cannot build InsightApplications without
>     ITK.  Please set
>      > ITK_DIR.")
>      >   ENDIF(ITK_FOUND)
>      >
>      > ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
>      >
>      > #
>      > # Find QT
>      > #
>      > INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
>      >
>      > INCLUDE_DIRECTORIES(
>      > ${QT_INCLUDE_DIR}
>      > ${QT_INCLUDE_PATH}
>      > )
>      >
>      > LINK_LIBRARIES (
>      > ITKIO
>      > ${QT_QT_LIBRARY}
>      > )
>      >
>      > SET(QtITK_SRCS
>      > itkQtProgressBar.cxx
>      > qtITK.cxx
>      > )
>      >
>      > SET(QtITK_MOC_SRCS
>      > itkQtAdaptor.h
>      > itkQtLightIndicator.h
>      > )
>      >
>      > #IF(QT_WRAP_CPP)
>      >   QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)
>      > #ENDIF(QT_WRAP_CPP)
>      >
>      >
>      > ADD_EXECUTABLE(QtITK QtITK_SRCS)
>      >
>      > #INSTALL_TARGETS(/bin QtITK)
>      >
>      >
>      > --
>      >
>      > I am using
>      > ccmake version 2.2-patch 2
>      >
>      > Thanks,
>      > --
>      > Gheorghe
>      >
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      >
>      > _______________________________________________
>      > Insight-users mailing list
>      > Insight-users at itk.org <mailto:Insight-users at itk.org>
>      > http://www.itk.org/mailman/listinfo/insight-users
>     <http://www.itk.org/mailman/listinfo/insight-users>
> 
> 
> 
> 
> -- 
> Gheorghe Postelnicu, PhD
> MGH, Harvard Medical School



More information about the Insight-users mailing list