Dear Alex,<div><br></div><div>Thanks for the response. I did not know about CRTs I am not too sure it can affect the static compilations.</div><div><br></div><div>Is it recommended for Win32 machines because I am running it on Vista and MSVC 2010.</div>
<div><br></div><div>I will probably clean up everthing do it again see if I can understand what is going on :)</div><div>Cheers,</div><div>Mehdi<br><div><br><br><div class="gmail_quote">On Mon, Dec 10, 2012 at 7:05 PM, Alex Malyushytskyy <span dir="ltr">&lt;<a href="mailto:alexmalvtk@gmail.com" target="_blank">alexmalvtk@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">Possible problem  - &quot;Static&quot;  Qt build is mostly likely using CRT dlls<br>
unless you manually edited project options. This means you can&#39;t link<br>
static VTK (using static CRTs with suck Qt). In fact you still have to<br>
link VTK  as dlls.<br>
<br>
I do no think nice solution exists. Some people claim that they were<br>
able to link Qt vs static CRTs. I personally tried this hard with Qt<br>
4.5<br>
and even though my application was running I had some problems with<br>
some cases ( from the top of my head setting specific item in combobox<br>
was giving access violation)<br>
<br>
But if you manage to do this and would not have any problem with Qt<br>
you can build static version of vtk and you will get wehat you want.<br>
Otherwise all you can get rid of - Qt dlls. Even though QT is build as<br>
&#39;static&#39; libraries it will be linked against dynamic CRTs which will<br>
force you to provide such CRTs as dependencies and unless you can link<br>
static VTK vs dynamic CRTS ( I am not sure how easy is it) you will<br>
have to build vtk as dlls.<br>
<br>
Alex<br>
<br>
On Mon, Dec 10, 2012 at 7:07 AM, Mehdi Esteghamatian<br>
<div><div class="h5">&lt;<a href="mailto:mehdiesteghamat@gmail.com">mehdiesteghamat@gmail.com</a>&gt; wrote:<br>
&gt; Yes many times.<br>
&gt;<br>
&gt; On Mon, Dec 10, 2012 at 8:54 AM, John Drescher &lt;<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Dec 10, 2012 at 12:59 AM, Mehdi Esteghamatian<br>
&gt;&gt; &lt;<a href="mailto:mehdiesteghamat@gmail.com">mehdiesteghamat@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Yes your right it should be fine although I am not getting it right yet.<br>
&gt;&gt; &gt; My<br>
&gt;&gt; &gt; previous qt was compiled dynamically. So, I still had to put QT dlls in<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; target folder.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Now I compiled the qt statically which is a bit confusing because It did<br>
&gt;&gt; &gt; not<br>
&gt;&gt; &gt; create separate folders for statics and dynamic libraries,  so now<br>
&gt;&gt; &gt; things<br>
&gt;&gt; &gt; look like below in lib folder (D:\...\QT\4.8.4\lib). For every library I<br>
&gt;&gt; &gt; have 4 versions. for example for QTCore I have the followings<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; QtCore.lib     -&gt;  static release<br>
&gt;&gt; &gt; QtCored.lib   -&gt; static debug<br>
&gt;&gt; &gt; QtCore.lib    -&gt; dynamic rlease<br>
&gt;&gt; &gt; QtCore.lib    -&gt; dynamic debug<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; NOW the problem is that I am getting redefinition link errors as below<br>
&gt;&gt; &gt; which<br>
&gt;&gt; &gt; is probably because Visual Studio (2010) still tries to compile the<br>
&gt;&gt; &gt; target<br>
&gt;&gt; &gt; dynamically which should no longer be the case.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I guess I need to somehow tell the VS to stick to static libraries only<br>
&gt;&gt; &gt; either directly or through CMakeLists.txt (which I am not good at).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please let me know if there is any suggestions.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Mehdi<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 1&gt;------ Build started: Project: SimpleView, Configuration: Debug Win32<br>
&gt;&gt; &gt; ------<br>
&gt;&gt; &gt; 1&gt;QtGuid4.lib(QtGuid4.dll) : error LNK2005: &quot;public: __thiscall<br>
&gt;&gt; &gt; QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum<br>
&gt;&gt; &gt; QSizePolicy::Policy)&quot;<br>
&gt;&gt; &gt; (??0QSizePolicy@@QAE@W4Policy@0@0@Z) already defined in SimpleView.obj<br>
&gt;&gt; &gt; 1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: __thiscall<br>
&gt;&gt; &gt; QString::~QString(void)&quot; (??1QString@@QAE@XZ) already defined in<br>
&gt;&gt; &gt; SimpleView.obj<br>
&gt;&gt; &gt; 1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: int __thiscall<br>
&gt;&gt; &gt; QSize::width(void)const &quot; (?width@QSize@@QBEHXZ) already defined in<br>
&gt;&gt; &gt; SimpleView.obj<br>
&gt;&gt; &gt; 1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: int __thiscall<br>
&gt;&gt; &gt; QSize::height(void)const &quot; (?height@QSize@@QBEHXZ) already defined in<br>
&gt;&gt; &gt; SimpleView.obj<br>
&gt;&gt; &gt; 1&gt;QtCored4.lib(QtCored4.dll) : error LNK2005: &quot;public: bool __thiscall<br>
&gt;&gt; &gt; QBasicAtomicInt::deref(void)&quot; (?deref@QBasicAtomicInt@@QAE_NXZ) already<br>
&gt;&gt; &gt; defined in SimpleView.obj<br>
&gt;&gt; &gt; 1&gt;SimpleView.obj : error LNK2001: unresolved external symbol &quot;private:<br>
&gt;&gt; &gt; static class QCoreApplication * QCoreApplication::self&quot;<br>
&gt;&gt; &gt; (?self@QCoreApplication@@0PAV1@A)<br>
&gt;&gt; &gt; 1&gt;moc_SimpleView.obj : error LNK2001: unresolved external symbol<br>
&gt;&gt; &gt; &quot;public:<br>
&gt;&gt; &gt; static struct QMetaObject const QMainWindow::staticMetaObject&quot;<br>
&gt;&gt; &gt; (?staticMetaObject@QMainWindow@@2UQMetaObject@@B)<br>
&gt;&gt; &gt; 1&gt;D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal<br>
&gt;&gt; &gt; error LNK1120: 2 unresolved externals<br>
&gt;&gt; &gt; ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped<br>
&gt;&gt; &gt; ==========<br>
&gt;&gt;<br>
&gt;&gt; Did you clean you build and also regenerate the visual studio solution<br>
&gt;&gt; using CMake-gui?<br>
&gt;&gt;<br>
&gt;&gt; John<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<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></div>