[vtkusers] Linking to VTK static libraries on Windows

Gib Bogle g.bogle at auckland.ac.nz
Fri Oct 15 23:30:44 EDT 2010


On 15/10/2010 5:37 p.m., John Drescher wrote:
>> I'm focussing on this because the vtkCylinderSource link error also occurs
>> when I build the application that I originally posted about.  This current
>> example looks more tractable because there is only this single error.
>>
>> I've looked carefully at the Project Properties for the Cylinder build, and
>> I've made sure that the QVTK_test Properties are the same, or as close as
>> possible (my program uses Qt, so there are additional libraries and include
>> directories).  I am using exactly the same libraries, in the same order
>> (except for the extra Qt libraries).  All to no avail - I still get the
>> unresolved external symbol error for vtkCylinderSource::New(void).
>>
>> I've been ignoring the warnings, because I don't understand them.  Maybe
>> they are significant.
>
> My suggestion: Build your examples using cmake until you get the hang
> of doing linking vtk the hard way. Static linking works without any
> fuss at all this way ( I know I have not had problems linking vtk in
> almost 3 years.. Just look at the generated visual studio project
> files to learn how to use vtk without cmake.

I found my mistake.  I was using project settings based on those for the shared 
library linking, and forgot to change the include path to vtkconfigure.h.  I 
have now built my Qt-VTK app on Windows XP, Windows 7, Linux, and Mac OSX, with 
both static and shared VTK libraries.



More information about the vtkusers mailing list