Hi Gib,<div><br></div><div>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&#39;t be built when doing a static build.</div>

<div><br></div><div><div>2&gt;     Creating library C:/Kitware/VTK/bin64-static/bin/Release/QVTKWidgetPlugin.lib and object C:/Kitware/VTK/bin64-static/bin/Release/QVTKWidgetPlugin.exp</div><div>2&gt;QtGui.lib(qaccessible_win.obj) : error LNK2019: unresolved external symbol __imp_PlaySoundW referenced in function &quot;public: static void __cdecl QAccessible::updateAccessibility(class QObject *,int,enum QAccessible::Event)&quot; (?updateAccessibility@QAccessible@@SAXPEAVQObject@@HW4Event@1@@Z)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmGetDefaultIMEWnd referenced in function &quot;struct HWND__ * __cdecl getDefaultIMEWnd(struct HWND__ *)&quot; (?getDefaultIMEWnd@@YAPEAUHWND__@@PEAU1@@Z)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmGetContext referenced in function &quot;struct HIMC__ * __cdecl getContext(struct HWND__ *)&quot; (?getContext@@YAPEAUHIMC__@@PEAUHWND__@@@Z)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmReleaseContext referenced in function &quot;void __cdecl releaseContext(struct HWND__ *,struct HIMC__ *)&quot; (?releaseContext@@YAXPEAUHWND__@@PEAUHIMC__@@@Z)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmNotifyIME referenced in function &quot;void __cdecl notifyIME(struct HIMC__ *,unsigned long,unsigned long,unsigned long)&quot; (?notifyIME@@YAXPEAUHIMC__@@KKK@Z)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmGetCompositionStringW referenced in function &quot;long __cdecl getCompositionString(struct HIMC__ *,unsigned long,void *,unsigned long)&quot; (?getCompositionString@@YAJPEAUHIMC__@@KPEAXK@Z)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmAssociateContext referenced in function &quot;void __cdecl enableIme(class QWidget *,bool)&quot; (?enableIme@@YAXPEAVQWidget@@_N@Z)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmSetCandidateWindow referenced in function &quot;public: virtual void __cdecl QWinInputContext::update(void)&quot; (?update@QWinInputContext@@UEAAXXZ)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmSetCompositionWindow referenced in function &quot;public: virtual void __cdecl QWinInputContext::update(void)&quot; (?update@QWinInputContext@@UEAAXXZ)</div>

<div>2&gt;QtGui.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol ImmSetCompositionFontW referenced in function &quot;public: virtual void __cdecl QWinInputContext::update(void)&quot; (?update@QWinInputContext@@UEAAXXZ)</div>

<div>2&gt;QtCore.lib(qeventdispatcher_win.obj) : error LNK2019: unresolved external symbol WSAAsyncSelect referenced in function &quot;public: void __cdecl QEventDispatcherWin32Private::doWsaAsyncSelect(int)&quot; (?doWsaAsyncSelect@QEventDispatcherWin32Private@@QEAAXH@Z)</div>

<div>2&gt;C:\Kitware\VTK\bin64-static\bin\Release\QVTKWidgetPlugin.dll : fatal error LNK1120: 11 unresolved externals</div><div><br></div><div>I am also getting some tiff symbol redefinitions that I will look into fixing.</div>

<div><br></div><div><div>8&gt;vtksqlite.lib(vtk_sqlite3.obj) : error LNK2005: winCurrentTime already defined in QtSql.lib(sqlite3.obj)</div><div>8&gt;C:\Kitware\VTK\bin64-static\bin\Release\QVTKCxxTests.exe : fatal error LNK1169: one or more multiply defined symbols found</div>

<div>8&gt;</div><div>8&gt;Build FAILED.</div><div>8&gt;</div><div>8&gt;Time Elapsed 00:00:02.04</div><div>7&gt;vtktiff.lib(tif_warning.obj) : error LNK2005: _TIFFwarningHandlerExt already defined in QtGui.lib(tif_warning.obj)</div>

<div>7&gt;vtktiff.lib(tif_error.obj) : error LNK2005: _TIFFerrorHandlerExt already defined in QtGui.lib(tif_error.obj)</div><div>7&gt;vtktiff.lib(tif_win32.obj) : error LNK2005: TIFFOpenW already defined in QtGui.lib(tif_win32.obj)</div>

<div>7&gt;C:\Kitware\VTK\bin64-static\bin\Release\ViewsCxxTests.exe : fatal error LNK1169: one or more multiply defined symbols found</div><div>7&gt;</div><div>7&gt;Build FAILED.</div><div>7&gt;</div><div>7&gt;Time Elapsed 00:00:02.42</div>

<div>10&gt;QtGui.lib(tif_win32.obj) : error LNK2005: TIFFOpenW already defined in vtktiff.lib(tif_win32.obj)</div><div>10&gt;QtGui.lib(tif_error.obj) : error LNK2005: _TIFFerrorHandlerExt already defined in vtktiff.lib(tif_error.obj)</div>

<div>10&gt;QtGui.lib(tif_warning.obj) : error LNK2005: _TIFFwarningHandlerExt already defined in vtktiff.lib(tif_warning.obj)</div><div>9&gt;vtktiff.lib(tif_warning.obj) : error LNK2005: _TIFFwarningHandlerExt already defined in QtGui.lib(tif_warning.obj)</div>

<div>9&gt;vtktiff.lib(tif_error.obj) : error LNK2005: _TIFFerrorHandlerExt already defined in QtGui.lib(tif_error.obj)</div><div>9&gt;vtktiff.lib(tif_win32.obj) : error LNK2005: TIFFOpenW already defined in QtGui.lib(tif_win32.obj)</div>

<div>9&gt;C:\Kitware\VTK\bin64-static\bin\Release\ChartsCxxTests.exe : fatal error LNK1169: one or more multiply defined symbols found</div><div>9&gt;</div><div>9&gt;Build FAILED.</div><div>9&gt;</div><div>9&gt;Time Elapsed 00:00:03.25</div>

<div>10&gt;C:\Kitware\VTK\bin64-static\bin\Release\GeovisCxxTests.exe : fatal error LNK1169: one or more multiply defined symbols found</div><div>10&gt;</div><div>10&gt;Build FAILED.</div><div>10&gt;</div></div><div><br>
</div>
<div class="gmail_quote">On Thu, Sep 23, 2010 at 10:50 PM, Gib Bogle <span dir="ltr">&lt;<a href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


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@16, and the following are to Qt functions.<br>



<br>
[ 89%] Built target QVTK<br>
Linking CXX shared library ..\..\bin\libQVTKWidgetPlugin.dll<br>
Creating library file: ..\..\bin\libQVTKWidgetPlugin.dll.a<br>
C:\Qt\4.7.0\lib\libQtCore.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x523): undefined reference to `WSAAsyncSelect@16&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qwidget.o):qwidget.cpp:(.text+0x578a): undefined reference to `QtSharedPointer::ExternalRefCountData::getAndRef(QObject const*)&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x28ef): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2956): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2b9b): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2c0a): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2d0b): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x2d72): more<br>
 undefined references to `QBasicTimer::stop()&#39; follow<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x37da): undefined reference to `QBasicTimer::start(int, QObject*)&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x384f): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x385d): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x3e5c): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x3e6a): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x4473): undefined reference to `QBasicTimer::stop()&#39;<br>
C:\Qt\4.7.0\lib\libQtGui.a(qapplication.o):qapplication.cpp:(.text+0x4481): more<br>
 undefined references to `QBasicTimer::stop()&#39; follow<br>
<br>
etc.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>
</div>