[vtkusers] undefined reference

Aida Ninyerola aida.ninyerola at gmail.com
Wed May 30 08:21:26 EDT 2018


Hi,

While compiling my project I get some linking problems.
tlQuantification.cpp:(.text+0x1623): undefined reference to
`vtkPolyDataToImageStencil::New()'
tlQuantification.cpp:(.text+0x162b): undefined reference to
`vtkImageAccumulate::New()'
tlQuantification.cpp:(.text+0x168e): undefined reference to
`vtkImageAccumulate::SetStencilData(vtkImageStencilData*)'

I found that I sould add in CmakeLists.txt the following lines but I
doesn't work:
if(VTK_LIBRARIES)
  target_link_libraries(quantification ${VTK_LIBRARIES} )
else()
  target_link_libraries(quantification vtkHybrid vtkWidgets)
endif()

I'm trying to compile and old project that work properly with a former VTK
version (I can't remember the VTK version).

I was thinking that maybe is a migration problem but I'm not able to find
what I need to change.

What I'm doing is clipping an image by a cylinder (m_rotate_tformer[id]) to
calculate the mean activity of the image inside the cylinder. Maybe there
is a better way to perform it.

    vtkPolyDataToImageStencil* sts = vtkPolyDataToImageStencil::New();
    vtkImageAccumulate* act = vtkImageAccumulate::New();

    sts->SetInputData(m_rotate_tformer[id]->GetPolyDataOutput());
    sts->SetInformationInput(vtkInputImage.GetPointer());
    sts->Update();

    act->SetInputData(vtkInputImage.GetPointer());
    act->SetStencilData(sts->GetOutput());
    act->Update();

I'm running out of ideas. I'll appreciate any idea.

Thanks,
Aida
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180530/7fe79ebb/attachment.html>


More information about the vtkusers mailing list