[Insight-users] QtITK linking problems

Julien Jomier jjomier at cs.unc.edu
Thu Jul 22 19:02:36 EDT 2004


Rudi, Luis,

This is the same problem Oliveira Marcelo reported two days ago.
This is a problem with CMake 2.0.2 not wrapping cpp for Qt.
An easy fix is to edit the QtITK/CMakeLists.txt and comment out the
following lines:

#IF(QT_WRAP_CPP)
  QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)
#ENDIF(QT_WRAP_CPP)

Bill fixed it in the CMake cvs repository so this shouldn't be a problem
anymore with CMake 2.0.3.

best regards,

Julien

> -----Original Message-----
> From: insight-users-bounces at itk.org 
> [mailto:insight-users-bounces at itk.org] On Behalf Of Rudi Ratlos
> Sent: Thursday, July 22, 2004 6:49 PM
> To: Luis Ibanez
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] QtITK linking problems
> 
> 
> Hi Luis,
> thanks for your help. I am using CMake 2.0.2 and the
> following CMakeLists.txt:
> 
> PROJECT(QtITKExample)
> 
> 
> ################################################### 
> # Find ITK
> #
> INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
> IF (USE_ITK_FILE)
> INCLUDE(${USE_ITK_FILE})
> ENDIF(USE_ITK_FILE)
> # 
> # Find QT
> #
> INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
> INCLUDE_DIRECTORIES(
> ${QT_INCLUDE_DIR}
> ${QT_INCLUDE_PATH}
> )
> LINK_LIBRARIES (
>    ITKCommon
>    ITKBasicFilters
>    ITKAlgorithms
>    ITKIO
>    itkpng
>    itkzlib
>    ${QT_QT_LIBRARY}
>  )
> IF(WIN32)
> ADD_DEFINITIONS(-DQT_DLL) 
> ENDIF(WIN32)
> 
> 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)
> 
> #####################################################
> 
> and I am getting following errors:
> 
> Linking...
>    Creating library Debug/QtITK.lib and object
> Debug/QtITK.exp
> qtITK.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall
> itk::QtTranslator::initMetaObject(void)"
> (?initMetaObject at QtTranslator@itk@@MAEXXZ)
> qtITK.obj : error LNK2001: unresolved external symbol
> "public: virtual char const * __thiscall
> itk::QtTranslator::className(void)const "
> (?className at QtTranslator@itk@@UBEPBDXZ)
> qtITK.obj : error LNK2001: unresolved external symbol
> "public: static class QMetaObject * __cdecl
> itk::QtTranslator::staticMetaObject(void)"
> (?staticMetaObject at QtTranslator@itk@@SAPAVQMetaObject@@XZ)
> qtITK.obj : error LNK2001: unresolved external symbol
> "protected: void __thiscall
> itk::QtTranslator::Signal(void)"
> (?Signal at QtTranslator@itk@@IAEXXZ)
> qtITK.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall
> itk::QtLightIndicator::initMetaObject(void)"
> (?initMetaObject at QtLightIndicator@itk@@MAEXXZ)
> qtITK.obj : error LNK2001: unresolved external symbol
> "public: virtual char const * __thiscall
> itk::QtLightIndicator::className(void)const "
> (?className at QtLightIndicator@itk@@UBEPBDXZ)
> qtITK.obj : error LNK2001: unresolved external symbol
> "public: static class QMetaObject * __cdecl
> itk::QtLightIndicator::staticMetaObject(void)"
> (?staticMetaObject at QtLightIndicator@itk@@SAPAVQMetaObject@@XZ)
> Debug/QtITK.exe : fatal error LNK1120: 7 unresolved
> externals
> Error executing link.exe.
> 
> ALL_BUILD - 8 error(s), 0 warning(s)
> 
> 
> Thanks again for your help
> Rudi
> 
> 
> --- Luis Ibanez <luis.ibanez at kitware.com> wrote:
> > 
> > Hi Rudi,
> > 
> > The symbols that you are missing are defined in
> > 
> >    - itkQtProgressBar.cxx
> >    - itkQtLightIndicator.cxx
> > 
> > in the same directory QtITK
> > 
> > Are you modifying the CMakeList.txt file of
> > this application ?
> > (if so, please post your modified CMakeLists.txt
> > file to the list.)
> > 
> > 
> > What version of CMake are you using ?
> > 
> > 
> > Please let us know,
> > 
> > 
> >    Thanks
> > 
> > 
> > 
> >       Luis
> > 
> > 
> > --------------------
> > Rudi Ratlos wrote:
> > > Hi,
> > > try to run \InsightApplications\QtIT, compiles but
> > get
> > > the following link problems. I added all libraries
> > > correctly in cmake. Don't have a clue. Any help
> > > appreciated ! Thanks
> > > Rudi
> > > 
> > > Linking...
> > >    Creating library Debug/QtITK.lib and object
> > > Debug/QtITK.exp
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "public: void __thiscall
> > > itk::QtProgressBar::Observe(class itk::Object *)"
> > > (?Observe at QtProgressBar@itk@@QAEXPAVObject at 2@@Z)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "public: __thiscall
> > > itk::QtProgressBar::QtProgressBar(class QWidget
> > *,char
> > > *)" (??0QtProgressBar at itk@@QAE at PAVQWidget@@PAD at Z)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "private: static struct QStringData *
> > > QString::shared_null"
> > > (?shared_null at QString@@0PAUQStringData@@A)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "protected: virtual void __thiscall
> > > itk::QtTranslator::initMetaObject(void)"
> > > (?initMetaObject at QtTranslator@itk@@MAEXXZ)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "public: virtual char const * __thiscall
> > > itk::QtTranslator::className(void)const "
> > > (?className at QtTranslator@itk@@UBEPBDXZ)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "public: static class QMetaObject * __cdecl
> > > itk::QtTranslator::staticMetaObject(void)"
> > >
> >
> (?staticMetaObject at QtTranslator@itk@@SAPAVQMetaObject@@XZ)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "protected: void __thiscall
> > > itk::QtTranslator::Signal(void)"
> > > (?Signal at QtTranslator@itk@@IAEXXZ)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "protected: virtual void __thiscall
> > > itk::QtLightIndicator::initMetaObject(void)"
> > > (?initMetaObject at QtLightIndicator@itk@@MAEXXZ)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "public: virtual char const * __thiscall
> > > itk::QtLightIndicator::className(void)const "
> > > (?className at QtLightIndicator@itk@@UBEPBDXZ)
> > > qtITK.obj : error LNK2001: unresolved external
> > symbol
> > > "public: static class QMetaObject * __cdecl
> > > itk::QtLightIndicator::staticMetaObject(void)"
> > >
> >
> (?staticMetaObject at QtLightIndicator@itk@@SAPAVQMetaObject@@XZ)
> > > Debug/QtITK.exe : fatal error LNK1120: 10
> > unresolved
> > > externals
> > > Error executing link.exe.
> > > 
> > > 
> > > ALL_BUILD - 11 error(s), 0 warning(s)
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > > http://mail.yahoo.com 
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users at itk.org
> > > http://www.itk.org/mailman/listinfo/insight-users
> > > 
> > 
> > 
> > 
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 



More information about the Insight-users mailing list