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"><<a href="mailto:alexmalvtk@gmail.com" target="_blank">alexmalvtk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Possible problem - "Static" Qt build is mostly likely using CRT dlls<br>
unless you manually edited project options. This means you can'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>
'static' 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"><<a href="mailto:mehdiesteghamat@gmail.com">mehdiesteghamat@gmail.com</a>> wrote:<br>
> Yes many times.<br>
><br>
> On Mon, Dec 10, 2012 at 8:54 AM, John Drescher <<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Dec 10, 2012 at 12:59 AM, Mehdi Esteghamatian<br>
>> <<a href="mailto:mehdiesteghamat@gmail.com">mehdiesteghamat@gmail.com</a>> wrote:<br>
>> > Yes your right it should be fine although I am not getting it right yet.<br>
>> > My<br>
>> > previous qt was compiled dynamically. So, I still had to put QT dlls in<br>
>> > the<br>
>> > target folder.<br>
>> ><br>
>> > Now I compiled the qt statically which is a bit confusing because It did<br>
>> > not<br>
>> > create separate folders for statics and dynamic libraries, so now<br>
>> > things<br>
>> > look like below in lib folder (D:\...\QT\4.8.4\lib). For every library I<br>
>> > have 4 versions. for example for QTCore I have the followings<br>
>> ><br>
>> > QtCore.lib -> static release<br>
>> > QtCored.lib -> static debug<br>
>> > QtCore.lib -> dynamic rlease<br>
>> > QtCore.lib -> dynamic debug<br>
>> ><br>
>> > NOW the problem is that I am getting redefinition link errors as below<br>
>> > which<br>
>> > is probably because Visual Studio (2010) still tries to compile the<br>
>> > target<br>
>> > dynamically which should no longer be the case.<br>
>> ><br>
>> > I guess I need to somehow tell the VS to stick to static libraries only<br>
>> > either directly or through CMakeLists.txt (which I am not good at).<br>
>> ><br>
>> > Please let me know if there is any suggestions.<br>
>> ><br>
>> > Regards,<br>
>> ><br>
>> > Mehdi<br>
>> ><br>
>> ><br>
>> > 1>------ Build started: Project: SimpleView, Configuration: Debug Win32<br>
>> > ------<br>
>> > 1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall<br>
>> > QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum<br>
>> > QSizePolicy::Policy)"<br>
>> > (??0QSizePolicy@@QAE@W4Policy@0@0@Z) already defined in SimpleView.obj<br>
>> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall<br>
>> > QString::~QString(void)" (??1QString@@QAE@XZ) already defined in<br>
>> > SimpleView.obj<br>
>> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall<br>
>> > QSize::width(void)const " (?width@QSize@@QBEHXZ) already defined in<br>
>> > SimpleView.obj<br>
>> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall<br>
>> > QSize::height(void)const " (?height@QSize@@QBEHXZ) already defined in<br>
>> > SimpleView.obj<br>
>> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall<br>
>> > QBasicAtomicInt::deref(void)" (?deref@QBasicAtomicInt@@QAE_NXZ) already<br>
>> > defined in SimpleView.obj<br>
>> > 1>SimpleView.obj : error LNK2001: unresolved external symbol "private:<br>
>> > static class QCoreApplication * QCoreApplication::self"<br>
>> > (?self@QCoreApplication@@0PAV1@A)<br>
>> > 1>moc_SimpleView.obj : error LNK2001: unresolved external symbol<br>
>> > "public:<br>
>> > static struct QMetaObject const QMainWindow::staticMetaObject"<br>
>> > (?staticMetaObject@QMainWindow@@2UQMetaObject@@B)<br>
>> > 1>D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal<br>
>> > error LNK1120: 2 unresolved externals<br>
>> > ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped<br>
>> > ==========<br>
>><br>
>> Did you clean you build and also regenerate the visual studio solution<br>
>> using CMake-gui?<br>
>><br>
>> John<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <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:<br>
> <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>
><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>