[vtkusers] Static Link VTK

Mehdi Esteghamatian mehdiesteghamat at gmail.com
Mon Dec 10 10:07:20 EST 2012


Yes many times.

On Mon, Dec 10, 2012 at 8:54 AM, John Drescher <drescherjm at gmail.com> wrote:

> On Mon, Dec 10, 2012 at 12:59 AM, Mehdi Esteghamatian
> <mehdiesteghamat at gmail.com> wrote:
> > 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.
> >
> > 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
> >
> > QtCore.lib     ->  static release
> > QtCored.lib   -> static debug
> > QtCore.lib    -> dynamic rlease
> > QtCore.lib    -> dynamic debug
> >
> > NOW 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.
> >
> > 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).
> >
> > Please let me know if there is any suggestions.
> >
> > Regards,
> >
> > Mehdi
> >
> >
> > 1>------ Build started: Project: SimpleView, Configuration: Debug Win32
> > ------
> > 1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall
> > QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum
> QSizePolicy::Policy)"
> > (??0QSizePolicy@@QAE at W4Policy@0 at 0@Z) already defined in SimpleView.obj
> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall
> > QString::~QString(void)" (??1QString@@QAE at XZ) already defined in
> > SimpleView.obj
> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall
> > QSize::width(void)const " (?width at QSize@@QBEHXZ) already defined in
> > SimpleView.obj
> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall
> > QSize::height(void)const " (?height at QSize@@QBEHXZ) already defined in
> > SimpleView.obj
> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall
> > QBasicAtomicInt::deref(void)" (?deref at QBasicAtomicInt@@QAE_NXZ) already
> > defined in SimpleView.obj
> > 1>SimpleView.obj : error LNK2001: unresolved external symbol "private:
> > static class QCoreApplication * QCoreApplication::self"
> > (?self at QCoreApplication@@0PAV1 at A)
> > 1>moc_SimpleView.obj : error LNK2001: unresolved external symbol "public:
> > static struct QMetaObject const QMainWindow::staticMetaObject"
> > (?staticMetaObject at QMainWindow@@2UQMetaObject@@B)
> > 1>D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal
> > error LNK1120: 2 unresolved externals
> > ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped
> ==========
>
> Did you clean you build and also regenerate the visual studio solution
> using CMake-gui?
>
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121210/89b339a3/attachment.htm>


More information about the vtkusers mailing list