[vtkusers] VTK and Qt, static build

Gib Bogle g.bogle at auckland.ac.nz
Sun Sep 19 21:45:16 EDT 2010


I've been spending a couple of days trying to build a static version of 
Qt-4.6.3, then linking it into a static build of VTK, with the aim of being able 
to distribute a single execution file instead of a big package of DLLs.  This 
process has been fraught with problems, and I'm posting about it in the hope 
that someone else has ventured down the same path.  A forlorn hope, perhaps.

The static build of Qt-4.6.3 has errors that can be side-stepped (loosely based 
on info from Nokia) by replacing
Q_DECL_IMPORT extern
by
Q_CORE_EXPORT
in a couple of files.  This generates static Qt libraries, but when these are 
used in the VTK build (with Qt) there are many "undefined reference" errors 
referring to Qt functions.

Can VTK be built static using static Qt libraries?  Do I need to do anything 
special in the cmake configure?  As it is I see that the .a versions of the 
libraries are being selected.  It isn't clear to me what is the root cause of 
the compile errors I'm seeing.



More information about the vtkusers mailing list