[vtkusers] undefined reference

Marc Ruiz Altisent marc.ruiz+vtk at gmail.com
Wed May 30 13:07:18 EDT 2018


I mean putting them in your CMakeLists.txt in target_link_libraries.

Missatge de Aida Ninyerola <aida.ninyerola at gmail.com> del dia dc., 30 de
maig 2018 a les 18:51:

> Hi,
>
> Thanks for your response but I'm not sure if I understand what you say.
>
> Do you mean I need to add these libraries in CMakeLists.txt of my project
> or do I need to make changes in my code?
>
> Thank you in advance!
> Aida
>
> On 30 May 2018 at 15:11, Marc Ruiz Altisent <marc.ruiz+vtk at gmail.com>
> wrote:
>
>> Hi Aida,
>>
>> VTK changed to a modular system some time ago and the library names
>> changed. You just need to find the new ones. The names match the directory
>> containg the classes: for example vtkPolyDataToImageStencil is in
>> Imaging/Stencil and the library is vtkImagingStencil, with a suffix of the
>> VTK version, e.g. vtkImagingStencil-8.1. Similarly, for vtkImageAccumulate
>> you need vtkImagingStatistics (+ suffix).
>>
>> Missatge de Aida Ninyerola <aida.ninyerola at gmail.com> del dia dc., 30 de
>> maig 2018 a les 14:22:
>>
>>> 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
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> https://public.kitware.com/mailman/listinfo/vtkusers
>>>
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180530/fb71b3e8/attachment.html>


More information about the vtkusers mailing list