[vtkusers] creating a dll with CMake for a VTK project

John Drescher drescherjm at gmail.com
Mon Jul 19 12:14:42 EDT 2010


> I have a my project which uses VTK (and ITK and Qt). Now I need to deploy
> this project to other machines. For that, I figured out I need to have a
> .dll and not a .lib for my project. For that, I added the following line to
> my CMakeLists.txt file:
>
> ADD_LIBRARY(MyLib SHARED ${SRCS} ${HDRS})
>
> However, this gives me a slew of errors in the .obj files. They look
> something like: "public: class vtkImageData * __thiscall
> vtkImageAlgorithm::GetOutput(void)"
> (?GetOutput at vtkImageAlgorithm@@QAEPAVvtkImageData@@XZ)
>
>
> Could someone please help me to figure out a way to allow visual studio to
> build a library for me?
>
It looks like you are not linking your dll to vtk libs.

>
> Is there a better way to do this?
>
This is the preferred way to do this.

John



More information about the vtkusers mailing list