[vtkusers] undefined reference to `vtkImageData::SetNumberOfScalarComponents(int)' ...

David Doria daviddoria+vtk at gmail.com
Sat Sep 4 19:07:53 EDT 2010


On Sat, Sep 4, 2010 at 6:50 PM, Andrew A <scratchboom at gmail.com> wrote:
> I use vtk 5.6.0
>
> in vtkImageData.h there are lines:
>
> // Description:
>  // Set/Get the number of scalar components for points. As with the
>  // SetScalarType method this is setting pipeline info.
>  void SetNumberOfScalarComponents( int n );
>  int GetNumberOfScalarComponents();

My mistake - that is a linker error, so the functions all seemed to be
defined. I believe the problem is that you have only specified the
"base directory" of the VTK include/library directories. I don't
believe -I or -L set the directories recursively.

We encourage you to use the CMakeLists.txt files provided with the
examples (at the bottom of every example). There are instructions on
how do to this here:

http://www.vtk.org/Wiki/VTK/Examples/Instructions/ForUsers#Build_an_example

This should setup everything correctly so you can just type 'make' to
build the example.

Please let us know how it goes.

David



More information about the vtkusers mailing list