[vtkusers] Static Qt and static VTK - is it possible?

Dave Partyka dave.partyka at kitware.com
Fri Sep 24 07:39:08 EDT 2010


Hi Gib,

I have recreated similar compile errors while building static vtk against
static qt with Visual Studio 10 and Qt 4.7. I am not entirely positive but I
suspect that QVTKWidgetPlugin shouldn't be built when doing a static build.

2>     Creating library
C:/Kitware/VTK/bin64-static/bin/Release/QVTKWidgetPlugin.lib and object
C:/Kitware/VTK/bin64-static/bin/Release/QVTKWidgetPlugin.exp
2>QtGui.lib(qaccessible_win.obj) : error LNK2019: unresolved external symbol
__imp_PlaySoundW referenced in function "public: static void __cdecl
QAccessible::updateAccessibility(class QObject *,int,enum
QAccessible::Event)" (?updateAccessibility at QAccessible@@SAXPEAVQObject@
@HW4Event at 1@@Z)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmGetDefaultIMEWnd referenced in function "struct HWND__ * __cdecl
getDefaultIMEWnd(struct HWND__ *)" (?getDefaultIMEWnd@@YAPEAUHWND__@@PEAU1@
@Z)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmGetContext referenced in function "struct HIMC__ * __cdecl
getContext(struct HWND__ *)" (?getContext@@YAPEAUHIMC__@@PEAUHWND__@@@Z)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmReleaseContext referenced in function "void __cdecl
releaseContext(struct HWND__ *,struct HIMC__ *)" (?releaseContext@
@YAXPEAUHWND__@@PEAUHIMC__@@@Z)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmNotifyIME referenced in function "void __cdecl notifyIME(struct
HIMC__ *,unsigned long,unsigned long,unsigned long)" (?notifyIME@
@YAXPEAUHIMC__@@KKK at Z)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmGetCompositionStringW referenced in function "long __cdecl
getCompositionString(struct HIMC__ *,unsigned long,void *,unsigned long)"
(?getCompositionString@@YAJPEAUHIMC__@@KPEAXK at Z)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmAssociateContext referenced in function "void __cdecl
enableIme(class QWidget *,bool)" (?enableIme@@YAXPEAVQWidget@@_N at Z)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmSetCandidateWindow referenced in function "public: virtual void
__cdecl QWinInputContext::update(void)" (?update at QWinInputContext@@UEAAXXZ)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmSetCompositionWindow referenced in function "public: virtual void
__cdecl QWinInputContext::update(void)" (?update at QWinInputContext@@UEAAXXZ)
2>QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external
symbol ImmSetCompositionFontW referenced in function "public: virtual void
__cdecl QWinInputContext::update(void)" (?update at QWinInputContext@@UEAAXXZ)
2>QtCore.lib(qeventdispatcher_win.obj) : error LNK2019: unresolved external
symbol WSAAsyncSelect referenced in function "public: void __cdecl
QEventDispatcherWin32Private::doWsaAsyncSelect(int)"
(?doWsaAsyncSelect at QEventDispatcherWin32Private@@QEAAXH at Z)
2>C:\Kitware\VTK\bin64-static\bin\Release\QVTKWidgetPlugin.dll : fatal error
LNK1120: 11 unresolved externals

I am also getting some tiff symbol redefinitions that I will look into
fixing.

8>vtksqlite.lib(vtk_sqlite3.obj) : error LNK2005: winCurrentTime already
defined in QtSql.lib(sqlite3.obj)
8>C:\Kitware\VTK\bin64-static\bin\Release\QVTKCxxTests.exe : fatal error
LNK1169: one or more multiply defined symbols found
8>
8>Build FAILED.
8>
8>Time Elapsed 00:00:02.04
7>vtktiff.lib(tif_warning.obj) : error LNK2005: _TIFFwarningHandlerExt
already defined in QtGui.lib(tif_warning.obj)
7>vtktiff.lib(tif_error.obj) : error LNK2005: _TIFFerrorHandlerExt already
defined in QtGui.lib(tif_error.obj)
7>vtktiff.lib(tif_win32.obj) : error LNK2005: TIFFOpenW already defined in
QtGui.lib(tif_win32.obj)
7>C:\Kitware\VTK\bin64-static\bin\Release\ViewsCxxTests.exe : fatal error
LNK1169: one or more multiply defined symbols found
7>
7>Build FAILED.
7>
7>Time Elapsed 00:00:02.42
10>QtGui.lib(tif_win32.obj) : error LNK2005: TIFFOpenW already defined in
vtktiff.lib(tif_win32.obj)
10>QtGui.lib(tif_error.obj) : error LNK2005: _TIFFerrorHandlerExt already
defined in vtktiff.lib(tif_error.obj)
10>QtGui.lib(tif_warning.obj) : error LNK2005: _TIFFwarningHandlerExt
already defined in vtktiff.lib(tif_warning.obj)
9>vtktiff.lib(tif_warning.obj) : error LNK2005: _TIFFwarningHandlerExt
already defined in QtGui.lib(tif_warning.obj)
9>vtktiff.lib(tif_error.obj) : error LNK2005: _TIFFerrorHandlerExt already
defined in QtGui.lib(tif_error.obj)
9>vtktiff.lib(tif_win32.obj) : error LNK2005: TIFFOpenW already defined in
QtGui.lib(tif_win32.obj)
9>C:\Kitware\VTK\bin64-static\bin\Release\ChartsCxxTests.exe : fatal error
LNK1169: one or more multiply defined symbols found
9>
9>Build FAILED.
9>
9>Time Elapsed 00:00:03.25
10>C:\Kitware\VTK\bin64-static\bin\Release\GeovisCxxTests.exe : fatal error
LNK1169: one or more multiply defined symbols found
10>
10>Build FAILED.
10>

On Thu, Sep 23, 2010 at 10:50 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

> Is it expecting too much to make both Qt and VTK static?  On Windows with
> mingw-4.4.0 I built Qt-4.7.0 statically, and am now trying to build VTK
> statically.  I was not aware if it was necessary, or if so how to do it, to
> tell the CMake configure that the Qt libraries are static.  The VTK build
> proceeds as far as building QVTK, but gets a million errors when trying to
> create libQVTKWidgetPlugin.dll.  The first undefined reference is to
> WSAAsyncSelect at 16, and the following are to Qt functions.
>
> [ 89%] Built target QVTK
> Linking CXX shared library ..\..\bin\libQVTKWidgetPlugin.dll
> Creating library file: ..\..\bin\libQVTKWidgetPlugin.dll.a
> C:\Qt\4.7.0\lib\libQtCore.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x523):
> undefined reference to `WSAAsyncSelect at 16'
> C:\Qt\4.7.0\lib\libQtGui.a(qwidget.o):qwidget.cpp:(.text+0x578a): undefined
> reference to `QtSharedPointer::ExternalRefCountData::getAndRef(QObject
> const*)'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x28ef):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2956):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2b9b):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2c0a):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2d0b):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2d72):
> more
>  undefined references to `QBasicTimer::stop()' follow
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x37da):
> undefined reference to `QBasicTimer::start(int, QObject*)'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x384f):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x385d):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x3e5c):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x3e6a):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x4473):
> undefined reference to `QBasicTimer::stop()'
> C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x4481):
> more
>  undefined references to `QBasicTimer::stop()' follow
>
> etc.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100924/cc280819/attachment.htm>


More information about the vtkusers mailing list