Yes your right it should be fine although I am not getting it right yet. My previous qt was compiled dynamically. So, I still had to put QT dlls in the target folder. <div><br></div><div>Now I compiled the qt statically which is a bit confusing because It did not create separate folders for statics and dynamic libraries,  so now things look like below in lib folder (D:\...\QT\4.8.4\lib). For every library I have 4 versions. for example for QTCore I have the followings</div>
<div><br></div><div>QtCore.lib     -&gt;  static release</div><div>QtCored.lib   -&gt; static debug</div><div>QtCore.lib    -&gt; dynamic rlease</div><div>QtCore.lib    -&gt; dynamic debug</div><div><br></div><div><b>NOW </b>the problem is that I am getting redefinition link errors as below which is probably because Visual Studio (2010) still tries to compile the target dynamically which should no longer be the case. </div>
<div><br></div><div>I guess I need to somehow tell the VS to stick to static libraries only either directly or through CMakeLists.txt (which I am not good at).</div><div><br></div><div>Please let me know if there is any suggestions.</div>
<div><br></div><div>Regards,</div><div><br></div><div>Mehdi</div><div><br></div><div><br></div><div><div>1&gt;------ Build started: Project: SimpleView, Configuration: Debug Win32 ------</div><div>1&gt;QtGuid4.lib(QtGuid4.dll) : error LNK2005: &quot;public: __thiscall QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum QSizePolicy::Policy)&quot; (??0QSizePolicy@@QAE@W4Policy@0@0@Z) already defined in SimpleView.obj</div>
<div>1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: __thiscall QString::~QString(void)&quot; (??1QString@@QAE@XZ) already defined in SimpleView.obj</div><div>1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: int __thiscall QSize::width(void)const &quot; (?width@QSize@@QBEHXZ) already defined in SimpleView.obj</div>
<div>1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: int __thiscall QSize::height(void)const &quot; (?height@QSize@@QBEHXZ) already defined in SimpleView.obj</div><div>1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: bool __thiscall QBasicAtomicInt::deref(void)&quot; (?deref@QBasicAtomicInt@@QAE_NXZ) already defined in SimpleView.obj</div>
<div>1&gt;SimpleView.obj : error LNK2001: unresolved external symbol &quot;private: static class QCoreApplication * QCoreApplication::self&quot; (?self@QCoreApplication@@0PAV1@A)</div><div>1&gt;moc_SimpleView.obj : error LNK2001: unresolved external symbol &quot;public: static struct QMetaObject const QMainWindow::staticMetaObject&quot; (?staticMetaObject@QMainWindow@@2UQMetaObject@@B)</div>
<div>1&gt;D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal error LNK1120: 2 unresolved externals</div><div>========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========</div><div><br></div>
<br><div class="gmail_quote">On Sun, Dec 9, 2012 at 8:29 PM, John Drescher <span dir="ltr">&lt;<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">&gt;&gt; Yes I already did that but the thing is that I am using QT as well for GUI<br>
&gt;&gt; stuff and as I turn off BUILD_SHARED_LIBS it dose not compile QVTK.lib which<br>
&gt;&gt; I guess it is because the my QT was compiled dynamically.<br>
<br>
</div>QVTK.lib will work fine without shared libraries. I have been using<br>
that this way for over 4 years (up to vtk-5.10.0 and Qt-4.8.4).<br>
<span class="HOEnZb"><font color="#888888"><br>
John<br>
</font></span></blockquote></div><br></div>