[Insight-users] Re: QtImage Viewer error

Luis Ibanez luis.ibanez at kitware.com
Wed, 21 Apr 2004 17:40:53 -0400


Hi Kaur,

The problem that you are facing doesn't have anything to do with ITK,
or with  ITK + Qt intergration.  You are simply missing to add a Qt library
to your link list.

A brute force solution is to go to the "lib" directory of your Qt 
installation,
take the names of all the libraries there and simply add the entire list 
to the
link command in your CMakeList.txt file.

That should resolve the missing symbol.

Once you get there, you could remove one by one the libraries, in order
to identify which one actually contains this symbol.


    Regards,



          Luis


----------------------
Kaur, Gulsheen wrote:

>Thanks Luis,
>
>  I did try in Qt mailing list and contacted their tech support directly as well. It seems, they are not much aware of Qt ITK integration.
>
>Well! I will work on this, and let you know if it works.
>
>Best Wishes,
>Gulsheen 
>
>
>-----Original Message-----
>From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>Sent: Wednesday, April 21, 2004 1:50 PM
>To: Kaur, Gulsheen
>Cc: Venkata Kalluru (E-mail); Insight-users at itk.org
>Subject: Re: QtImage Viewer error
>
>
>
>Hi Kaur,
>
>If the code works with the educational
>license of Qt, then we are fine  :-)
>
>The examples on the repository were
>developed for the free version of Qt.
>(That's 2.3 for windows).
>
>In order to be consistent with ITK
>license it doesn't make much sense
>for us to tune the demos for third
>party software that doesn't have an
>equivalent open source license.
>
>My guess is that the class in question,
>was probably moved to a different library
>on the commercial edition of Qt. Looking
>at the doc for 3.3 the class seems to
>still be there:
>http://doc.trolltech.com/3.3/qplatinumstyle.html
>
>
>You probably will get better information
>about this in a Qt related mailing list.
>
>
>If it is still giving you a hard time,
>I would suggest you to remove the use
>the the QPlatinumStyle and replace it
>with other style available.
>
>You can do that in the file
>
>          QtSlicerTest.cxx
>
>in
>
>   InsightApplications/
>                  Auxiliary/
>                         QtImageViewer
>
>
>
>   Regards,
>
>
>     Luis
>
>
>----------------------
>
>Kaur, Gulsheen wrote:
>
>  
>
>>Hello Luis,
>>
>>  I did associate QT_QT_LIBRARY variable in CMake during configuration. 
>>
>>
>> For your reference, I am attaching CMakeCache.txt from binary folder and a file with the variables I am setting for configuration during CMake.
>>
>>This works fine with the educational licence of Qt but not with the commercial license. I tried with Qt support as well but it still is not working.
>>
>>Hope to hear back from you soon.
>>
>>Thanks,
>>Gulsheen Kaur
>>
>>
>>-----Original Message-----
>>From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>>Sent: Tuesday, April 20, 2004 9:29 PM
>>To: Kaur, Gulsheen
>>Cc: Venkata Kalluru (E-mail); Insight-users at itk.org
>>Subject: Re: QtImage Viewer error
>>
>>
>>
>>Hi Kaur,
>>
>>The QPlatinumStyle class is in the libray,
>>
>>           qt-mt230nc.lib
>>
>>(in Qt version 2.3)
>>
>>It looks like during your configuration
>>process you are not finding all Qt libraries.
>>
>>Please look at the CMakeCache.txt file that
>>CMake creates for your project in the binary
>>directory.  One or more of the fundamental Qt
>>libraries may be missing there.
>>
>>Look for the libraries that get associated to
>>the QT_QT_LIBRARY variable in CMake.
>>
>>
>>
>>   Regards,
>>
>>
>>     Luis
>>
>>
>>-----------------------
>>Kaur, Gulsheen wrote:
>>
>>
>>    
>>
>>>Hello,
>>>
>>>  I am trying to run QtImage Viewer from (InsightApplications-1.4.0\Auxiliary\QtImageViewer) as an independent application but am not able to build properly. 
>>>
>>>-  Cmake file is attahced. 
>>>
>>>- Errors are stored in file -errorQt
>>>
>>>I am using ITK 1.4, ITK application 1.4  and Qt 3.3.1
>>>
>>>Hopefully, you will be able to help me.
>>>
>>>
>>><<Error Qt.txt>>  <<CMakeLists.txt>> 
>>>Thanks,
>>>Gulsheen Kaur
>>>
>>>
>>>
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>Linking...
>>>  Creating library Debug/QtSlicer.lib and object Debug/QtSlicer.exp
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QPlatinumStyle::pixelMetric(enum QStyle::PixelMetric,class QWidget const *)const " (?pixelMetric at QPlatinumStyle at  at UBEHW4PixelMetric at QStyle at  at PBVQWidget at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual class QRect __thiscall QPlatinumStyle::querySubControlMetrics(enum QStyle::ComplexControl,class QWidget const *,enum QStyle::SubControl,class QStyleOption const &)const " 
>>>(?querySubControlMetrics at QPlatinumStyle at  at UBE?AVQRect at  at W4ComplexControl at QStyle at  at PBVQWidget at  at W4SubControl at 4 at ABVQStyleOption at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QPlatinumStyle::drawComplexControl(enum QStyle::ComplexControl,class QPainter *,class QWidget const *,class QRect const &,class QColorGroup const &,unsigne
>>>d int,unsigned int,unsigned int,class QStyleOption const &)const " (?drawComplexControl at QPlatinumStyle at  at UBEXW4ComplexControl at QStyle at  at PAVQPainter at  at PBVQWidget at  at ABVQRect at  at ABVQColorGroup at  at IIIABVQStyleOption at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual class QRect __thiscall QPlatinumStyle::subRect(enum QStyle::SubRect,class QWidget const *)const " (?subRect at QPlatinumStyle at  at UBE?AVQRect at  at W4SubRect at QStyle at  at PBVQWidget at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QPlatinumStyle::drawControl(enum QStyle::ControlElement,class QPainter *,class QWidget const *,class QRect const &,class QColorGroup const &,unsigned int,c
>>>lass QStyleOption const &)const " (?drawControl at QPlatinumStyle at  at UBEXW4ControlElement at QStyle at  at PAVQPainter at  at PBVQWidget at  at ABVQRect at  at ABVQColorGroup at  at IABVQStyleOption at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QPlatinumStyle::drawPrimitive(enum QStyle::PrimitiveElement,class QPainter *,class QRect const &,class QColorGroup const &,unsigned int,class QStyleOption 
>>>const &)const " (?drawPrimitive at QPlatinumStyle at  at UBEXW4PrimitiveElement at QStyle at  at PAVQPainter at  at ABVQRect at  at ABVQColorGroup at  at IABVQStyleOption at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QPlatinumStyle::qt_property(int,int,class QVariant *)" (?qt_property at QPlatinumStyle at  at UAE_NHHPAVQVariant at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QPlatinumStyle::qt_emit(int,struct QUObject *)" (?qt_emit at QPlatinumStyle at  at UAE_NHPAUQUObject at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QPlatinumStyle::qt_invoke(int,struct QUObject *)" (?qt_invoke at QPlatinumStyle at  at UAE_NHPAUQUObject at  at  at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QPlatinumStyle::qt_cast(char const *)" (?qt_cast at QPlatinumStyle at  at UAEPAXPBD at Z)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall QPlatinumStyle::className(void)const " (?className at QPlatinumStyle at  at UBEPBDXZ)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "public: virtual class QMetaObject * __thiscall QPlatinumStyle::metaObject(void)const " (?metaObject at QPlatinumStyle at  at UBEPAVQMetaObject at  at XZ)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QPlatinumStyle::QPlatinumStyle(void)" (__imp_??0QPlatinumStyle at  at QAE at XZ)
>>>QtSlicerTest.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QPlatinumStyle::~QPlatinumStyle(void)" (__imp_??1QPlatinumStyle at  at UAE at XZ)
>>>Debug/QtSlicer.exe : fatal error LNK1120: 14 unresolved externals
>>>Error executing link.exe.
>>>ALL_BUILD - 15 error(s), 0 warning(s)
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>PROJECT(QtSlicer)
>>>
>>>INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
>>>INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake)
>>>
>>>
>>>#
>>>#  Find where ITK was Built or Installed.
>>>#
>>>FIND_PACKAGE(ITK)
>>>IF(ITK_FOUND)
>>> INCLUDE(${ITK_USE_FILE})
>>>ELSE(ITK_FOUND)
>>> MESSAGE(FATAL_ERROR
>>>         "Cannot build VolviewPlugIns without ITK.  Please set ITK_DIR.")
>>>ENDIF(ITK_FOUND)
>>>
>>>
>>>
>>>
>>>INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
>>>
>>>INCLUDE_DIRECTORIES(
>>>${QT_INCLUDE_DIR}
>>>${QtSlicer_BINARY_DIR}
>>>${QtSlicer_SOURCE_DIR}
>>>)
>>>
>>>
>>>
>>>LINK_LIBRARIES(
>>>${ITK_LIBRARIES}
>>>${QT_QT_LIBRARY}
>>>${QT_GL_LIBRARY}
>>>${OPENGL_glu_LIBRARY}
>>>${OPENGL_LIBRARY}
>>>)
>>>
>>>SET(QtSlicer_SRCS 
>>> QtSlicerTest.cxx
>>> QtGlSliceView.cxx
>>> QtSlicer.cxx
>>>)
>>>
>>>SET(QtSlicer_GUI_SRCS 
>>> QtSlicerGUI.ui
>>> QtSlicerHelpGUI.ui
>>>)
>>>
>>>
>>>SET(QtSlicer_MOC_SRCS 
>>> QtGlSliceView.h
>>>)
>>>
>>>IF(QT_WRAP_UI)
>>> QT_WRAP_UI(QtSlicer QtSlicer_HDRS  QtSlicer_SRCS  QtSlicer_GUI_SRCS )
>>>ENDIF(QT_WRAP_UI)
>>>
>>>IF(QT_WRAP_CPP)
>>> QT_WRAP_CPP(QtSlicer QtSlicer_SRCS QtSlicer_MOC_SRCS)
>>>ENDIF(QT_WRAP_CPP)
>>>
>>>ADD_DEFINITIONS(-DQT_DLL)
>>>
>>>ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
>>>
>>>ADD_EXECUTABLE(QtSlicer QtSlicer_SRCS)
>>>
>>>
>>>
>>>
>>>      
>>>
>
>
>
>  
>