[ITK-users] stand-alone lib -- ITKApps/ITKFilterLib

Dženan Zukić dzenanz at gmail.com
Mon Mar 21 16:20:32 EDT 2016


Hi Robert,

maybe you need to link to ITK statically? To accomplish this you probably
need to build ITK as static libraries (it is a configuration option in
CMake).

Regards,
Dženan

On Mon, Mar 21, 2016 at 12:50 PM, <Robert.Atwood at diamond.ac.uk> wrote:

> Hi,
> This example, ITKApps/ITKFilterLib, appears to be an example of what I
> want to do , bundle or encapsulate  a specific ITK-based filter into a
> library so that another program may just call it without having to have the
> ITK source installation available.
> However, a basic test for me is not working.
>
> I just tried to compile the test example from command line after building
> the library with Cmake as usual. I get hundreds of 'undefined reference',
> as if I have to link with all the ITK libs anyways.
> Am I missing something?
> Thanks
>
>
>
>
> g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib/
> -L . -l Example_ITKFilterLib
>
>
> First few lines of output:
>
> ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function
> `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, unsigned int,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const&, std::basic_string<char, std::char_traits<char>,
> std::allocator<char> > const&)':
> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39):
> undefined reference to
> `itk::ExceptionObject::ExceptionObject(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, unsigned int,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const&, std::basic_string<char, std::char_trait
> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44):
> undefined reference to `vtable for itk::MemoryAllocationError'
> ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function
> `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)':
> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x33):
> undefined reference to `itk::ExceptionObject::ExceptionObject(char const*,
> unsigned int, char const*, char const*)'
> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x3e):
> undefined reference to `vtable for itk::ProcessAborted'
> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x4f):
> undefined reference to `itk::ExceptionObject::SetDescription(char const*)'
> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x62):
> undefined reference to `itk::ExceptionObject::~ExceptionObject()'
>
>
>
> This is on a Linux Red Hat with ITK git master today (March 21 2016)
>
> cmake --version
> cmake version 2.8.12.2
>
> /proc/version:
>
> Linux version 2.6.32-573.18.1.el6.x86_64 (
> mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 (Red
> Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016
>
>
>
> --
> This e-mail and any attachments may contain confidential, copyright and or
> privileged material, and are for the use of the intended addressee only. If
> you are not the intended addressee or an authorised recipient of the
> addressee please notify us of receipt by returning the e-mail and do not
> use, copy, retain, distribute or disclose the information in or attached to
> the e-mail.
> Any opinions expressed within this e-mail are those of the individual and
> not necessarily of Diamond Light Source Ltd.
> Diamond Light Source Ltd. cannot guarantee that this e-mail or any
> attachments are free from viruses and we cannot accept liability for any
> damage which you may sustain as a result of software viruses which may be
> transmitted in or with the message.
> Diamond Light Source Limited (company no. 4375679). Registered in England
> and Wales with its registered office at Diamond House, Harwell Science and
> Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160321/cefcd517/attachment.html>


More information about the Insight-users mailing list