[Insight-users] Re: Qt + ITK integration

Luis Ibanez luis.ibanez@kitware.com
Thu May 20 00:18:02 EDT 2004


Hi Venkata,


Thanks for resending the Link errors.

You are getting both

    duplicate symbols and unresolved externals.


It simply seems that qt-mt331.lib is not
the library that you should be using.

It is likekely that the Qt distribution
from where you are taking qaxserver.lib
should have an equivalent library to qt-mt.

Note that you are also getting error messages
that are typical of the common mistake of
mixing code built for Release with code build
for Debug.

"LINK : warning LNK4098: defaultlib "MSVCRT"
  conflicts with use of other libs; use
  /NODEFAULTLIB:library"


Please check, and double check that *all* your
code and libraries are build for the *same*
compilation mode.


It will be a healty exercise for you to first
build a pure Qt application (no ITK involved)
that uses the library qaxserver.lib. You probably
will find there the reason for the link conflicts.



   Please let us know what you find.



      Thanks



         Luis




----------------
Venkata wrote:

> Hello Luis,
> 
> Sorry I forgot to attach the LINKER errors. Attached document contains the
> linker errors. Meanwhile I am going through your mail and trying to figure
> out what's going wrong. Anyway thank you very much in letting me know about
> these libraries. I am very sorry for disturbing you with my doubts.
> 
> Thanks
> -Venkat
> 
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez@kitware.com] 
> Sent: Wednesday, May 19, 2004 3:56 PM
> To: Venkata
> Cc: 'Kaur, Gulsheen'; Insight-users@itk.org
> Subject: Re: Qt + ITK integration
> 
> 
> Hi Venkat,
> 
> 
> There is no real mistery for integrating ITK and QT.
> 
> No specific libraries are needed for this purpose.
> All the necessary code is what you already found in
> 
>     InsightApplications/Auxiliary/QtImageViewer
> 
> You will find another example in
> 
>     InsightApplications/QtITK
> 
> that illustrates how to pass ITK events as Qt signal,
> and how to use ITK Command/Observers as Qt slots.
> 
> 
> ----
> 
> The incompatibility between the libraries
> 
>          qaxserver.lib
>          qt-mt331.lib
> 
> is not to be found in the ITK+Qt integration code.
> 
> It is very likely that mixing these two libraries
> in *any* Qt pure application will lead you to similar
> problems. (that is, if you remove all the ITK code,
> the problem will still be there.)
> 
> 
> I assume that you are finding duplicate symbols
> at link time when you add qaxserver.lib.
> 
> Is that what is happenning  ?
> 
> 
> (your attachement with linker errors didn't get
>   to my mailbox...)
> 
> 
> BTW are you making sure that you build your
> application using the same compilation mode
> everywhere  ?  (that is: Debug/Release...)
> 
> 
> --
> 
> 
> The reason why the QT libraries version have
> been changing on CMake is the natural difficulty
> for dealing with Qt multi-licenses.
> 
> You could easily overcome this problem by copying
> the file
> 
> 
>      CMake/Modules/FindQT.cmake
> 
> 
> renaming it and modifying its content in order to
> find the libraries that you need to use.
> 
> 
> 
> Please let us know what you find.
> 
> 
> 
>    Regards,
> 
> 
>       Luis
> 
> 
> 
> ----------------
> Venkata wrote:
> 
> 
>>Hello Luis,
>>
>> 
>>
>>We took Qtslicer application developed by ITK as an example for Qt + ITK 
>>integration. Based on this application we developed our own application 
>>that integrates Qt and ITK. As we are progressing in our application, we 
>>are in need of many Qt libraries for our application functionality. At 
>>one stage we are facing a clash between two Qt libraries (qaxserver.lib 
>>and qt-mt331.lib).  As we observed qt-mt331.lib is used for Qt + ITK 
>>integration and qaxserver.lib for the feature we want to implement to 
>>make our application web-enabled. I wanted to know is qt-mt331.lib that 
>>integrates Qt + ITK, because if I remove that library I am getting lot 
>>of errors. Therefore I thought it is the main library that integrates Qt 
>>and ITK.
>>
>> 
>>
>> Do different versions of CMAKE use different Qt libraries for Qt + ITK 
>>integration? When I observed CMake1.8 patch 1 it uses QT_QT_LIBRARY as 
>>qt-mtedu322.lib and CMake1.8 patch 3 uses qt-mt331.lib instead of 
>>qt-mtedu322.lib. Similarly I want to know is there any other library I 
>>need to use for the integration and resolve the clash with 
>>qaxserver.lib. For your reference I am attaching the LINKER errors.
>>
>> 
>>
>>Your response in this regard will be highly appreciated.
>>
>> 
>>
>>Thanks
>>
>>-Venkat
>>
>> 
>>
>>* *
>>
>> 
>>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> qaxserver.lib(qaxfactory.obj) : error LNK2005: "public: __thiscall QUuid::QUuid(unsigned int,unsigned short,unsigned short,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char)" (??0QUuid@@Q
> AE@IGGEEEEEEEE@Z) already defined in qt-mt331.lib(qt-mt331.dll)
> qaxserver.lib(qaxfactory.obj) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll)
> qaxserver.lib(qaxserverbase.obj) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll)
> qaxserver.lib(qaxserver.obj) : error LNK2005: "public: __thiscall QUuid::QUuid(unsigned int,unsigned short,unsigned short,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char)" (??0QUuid@@QA
> E@IGGEEEEEEEE@Z) already defined in qt-mt331.lib(qt-mt331.dll)
> qaxserver.lib(qaxserver.obj) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll)
> qaxserver.lib(types.obj) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll)
> qaxserver.lib(qaxservermain.obj) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll)
> qaxserver.lib(qaxfactory.obj) : warning LNK4006: "public: __thiscall QUuid::QUuid(unsigned int,unsigned short,unsigned short,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char)" (??0QUuid@
> @QAE@IGGEEEEEEEE@Z) already defined in qt-mt331.lib(qt-mt331.dll); second definition ignored
> qaxserver.lib(qaxfactory.obj) : warning LNK4006: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll); second definition ignored
> qaxserver.lib(qaxserverbase.obj) : warning LNK4006: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll); second definition ignored
> qaxserver.lib(qaxserver.obj) : warning LNK4006: "public: __thiscall QUuid::QUuid(unsigned int,unsigned short,unsigned short,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char)" (??0QUuid@@
> QAE@IGGEEEEEEEE@Z) already defined in qt-mt331.lib(qt-mt331.dll); second definition ignored
> qaxserver.lib(qaxserver.obj) : warning LNK4006: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll); second definition ignored
> qaxserver.lib(types.obj) : warning LNK4006: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll); second definition ignored
> qaxserver.lib(qaxservermain.obj) : warning LNK4006: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in qt-mt331.lib(qt-mt331.dll); second definition ignored
>    Creating library Debug/QtSlicer.lib and object Debug/QtSlicer.exp
> LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
> qaxserver.lib(qaxservermain.obj) : error LNK2001: unresolved external symbol "private: static struct QStringData * QString::shared_null" (?shared_null@QString@@0PAUQStringData@@A)
> qaxserver.lib(qaxfactory.obj) : error LNK2001: unresolved external symbol "private: static struct QStringData * QString::shared_null" (?shared_null@QString@@0PAUQStringData@@A)
> qaxserver.lib(qaxserverbase.obj) : error LNK2001: unresolved external symbol "private: static struct QStringData * QString::shared_null" (?shared_null@QString@@0PAUQStringData@@A)
> qaxserver.lib(qaxserver.obj) : error LNK2001: unresolved external symbol "private: static struct QStringData * QString::shared_null" (?shared_null@QString@@0PAUQStringData@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "private: static struct QStringData * QString::shared_null" (?shared_null@QString@@0PAUQStringData@@A)
> qaxserver.lib(qaxfactory.obj) : error LNK2001: unresolved external symbol "public: static class QString QString::null" (?null@QString@@2V1@A)
> qaxserver.lib(qaxserverbase.obj) : error LNK2001: unresolved external symbol "public: static class QString QString::null" (?null@QString@@2V1@A)
> qaxserver.lib(qaxserver.obj) : error LNK2001: unresolved external symbol "public: static class QString QString::null" (?null@QString@@2V1@A)
> qaxserver.lib(qaxserverbase.obj) : error LNK2001: unresolved external symbol "class QApplication * qApp" (?qApp@@3PAVQApplication@@A)
> qaxserver.lib(qaxserverdll.obj) : error LNK2001: unresolved external symbol "class QApplication * qApp" (?qApp@@3PAVQApplication@@A)
> qaxserver.lib(qaxserverbase.obj) : error LNK2001: unresolved external symbol "bool qt_winunicode" (?qt_winunicode@@3_NA)
> qaxserver.lib(qaxserverbase.obj) : error LNK2001: unresolved external symbol "struct QUType_int static_QUType_int" (?static_QUType_int@@3UQUType_int@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_int static_QUType_int" (?static_QUType_int@@3UQUType_int@@A)
> qaxserver.lib(qaxserverbase.obj) : error LNK2001: unresolved external symbol "struct QUType_Null static_QUType_Null" (?static_QUType_Null@@3UQUType_Null@@A)
> qaxserver.lib(qaxserver.obj) : error LNK2001: unresolved external symbol "struct QUType_enum static_QUType_enum" (?static_QUType_enum@@3UQUType_enum@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_enum static_QUType_enum" (?static_QUType_enum@@3UQUType_enum@@A)
> qaxserver.lib(qaxserver.obj) : error LNK2001: unresolved external symbol "struct QUType_ptr static_QUType_ptr" (?static_QUType_ptr@@3UQUType_ptr@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_ptr static_QUType_ptr" (?static_QUType_ptr@@3UQUType_ptr@@A)
> qaxserver.lib(qaxserver.obj) : error LNK2001: unresolved external symbol "struct QUType_QVariant static_QUType_QVariant" (?static_QUType_QVariant@@3UQUType_QVariant@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_QVariant static_QUType_QVariant" (?static_QUType_QVariant@@3UQUType_QVariant@@A)
> qaxserver.lib(qaxserver.obj) : error LNK2001: unresolved external symbol "struct QUType_varptr static_QUType_varptr" (?static_QUType_varptr@@3UQUType_varptr@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_varptr static_QUType_varptr" (?static_QUType_varptr@@3UQUType_varptr@@A)
> qaxserver.lib(qaxserverdll.obj) : error LNK2001: unresolved external symbol "bool qt_win_use_simple_timers" (?qt_win_use_simple_timers@@3_NA)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "private: static struct HPALETTE__ * QColor::hpal" (?hpal@QColor@@0PAUHPALETTE__@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_bool static_QUType_bool" (?static_QUType_bool@@3UQUType_bool@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_double static_QUType_double" (?static_QUType_double@@3UQUType_double@@A)
> qaxserver.lib(types.obj) : error LNK2001: unresolved external symbol "struct QUType_QString static_QUType_QString" (?static_QUType_QString@@3UQUType_QString@@A)
> Debug/QtSlicer.exe : fatal error LNK1120: 15 unresolved externals
> Error executing link.exe.
> 
> QtSlicer.exe - 35 error(s), 8 warning(s)






More information about the Insight-users mailing list