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 -> static release</div><div>QtCored.lib -> static debug</div><div>QtCore.lib -> dynamic rlease</div><div>QtCore.lib -> 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>------ Build started: Project: SimpleView, Configuration: Debug Win32 ------</div><div>1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum QSizePolicy::Policy)" (??0QSizePolicy@@QAE@W4Policy@0@0@Z) already defined in SimpleView.obj</div>
<div>1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in SimpleView.obj</div><div>1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall QSize::width(void)const " (?width@QSize@@QBEHXZ) already defined in SimpleView.obj</div>
<div>1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall QSize::height(void)const " (?height@QSize@@QBEHXZ) already defined in SimpleView.obj</div><div>1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall QBasicAtomicInt::deref(void)" (?deref@QBasicAtomicInt@@QAE_NXZ) already defined in SimpleView.obj</div>
<div>1>SimpleView.obj : error LNK2001: unresolved external symbol "private: static class QCoreApplication * QCoreApplication::self" (?self@QCoreApplication@@0PAV1@A)</div><div>1>moc_SimpleView.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QMainWindow::staticMetaObject" (?staticMetaObject@QMainWindow@@2UQMetaObject@@B)</div>
<div>1>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"><<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">>> Yes I already did that but the thing is that I am using QT as well for GUI<br>
>> stuff and as I turn off BUILD_SHARED_LIBS it dose not compile QVTK.lib which<br>
>> 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>