[Insight-developers] ITKExamples: Linker issues with an itk build with vtk

Matt McCormick matt.mccormick at kitware.com
Tue Nov 13 15:14:15 EST 2012


Thanks for the suggested fix.  Committed and pushed.

I agree that something should be done with ITK if possible to address
this, but I am not sure what.

The --as-needed linker flag may help, but it may also break things...

  http://www.gentoo.org/proj/en/qa/asneeded.xml

Thanks,
Matt

On Tue, Nov 13, 2012 at 7:28 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> I agree that it needs to be fixed (somehow) in ITK. But these examples
> should work with and ITKv4 release. These cmake lines allow that.
>
> On Tue, Nov 13, 2012 at 2:27 PM, David Doria <daviddoria at gmail.com> wrote:
>> On Tue, Nov 13, 2012 at 2:20 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>> Matt,
>>>
>>> I built the examples against my own ITK that included the vtk glue
>>> classes. In order to get the examples to link I had to add
>>> if(ITKVtkGlue_LOADED)
>>>   find_package( VTK REQUIRED )
>>>   if( ${VTK_FOUND} )
>>>     include( ${VTK_USE_FILE} )
>>>   endif()
>>> endif()
>>>
>>> to
>>> src/Examples/CMakeLists.txt
>>>
>>> This could very well be an ITK issue, but these changes allowed me to
>>> build and link the examples.
>>>
>>> Bill
>>
>> I believe I have seen several variants of this problem when building
>> other projects against ITK with ITKVtkGlue turned ON. Shouldn't ITK
>> already make VTK available to the client project? You shouldn't be
>> able to turn ITKVtkGlue on when building ITK if VTK is not found, so
>> one would assume that ITK has already included VTK since it requires
>> it. Then why should the client have to include it again?
>>
>> And potentially the same problem - I've had projects that do NOT
>> require VTK fail to link when built against an ITK build with
>> ITKVtkGlue turned on because they could not find VTK libs (even though
>> they don't require them).
>>
>> Summary - I think this is something that needs to be fixed in ITK (ITKVtkGlue).
>>
>> David
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com


More information about the Insight-developers mailing list