[vtkusers] undefined reference

Aida Ninyerola aida.ninyerola at gmail.com
Thu May 31 10:19:11 EDT 2018


Hi,

I'm sorry but I've tried both proposals and I still get "undefined
reference".
Can I check something else?

Thank you in adavance,
Aida

On 30 May 2018 at 20:47, Chiranjib Sur <sur.chiranjib at gmail.com> wrote:

> While running cmake use the option -DVTK_Dir=<VTK Installation Path>.
> This will solve the undefined search of the "development" libraries your
> code need.
> Hope that helps.
>
>
> Thanks and regards,
> Chiranjib
>
> On Wed, May 30, 2018 at 10:37 PM, Marc Ruiz Altisent <
> marc.ruiz+vtk at gmail.com> wrote:
>
>> 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
>>>
>>
>> _______________________________________________
>> 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/20180531/90297e59/attachment.html>


More information about the vtkusers mailing list