[Rtk-users] Linking error with rtkLookupTableImageFilter.h

Simon Rit simon.rit at creatis.insa-lyon.fr
Sat May 30 05:49:00 EDT 2015


Hi,
I didn't manage to reprocude your problem quickly but my guess is that
the problem is that the template specializations in this class have
not been declare inline. Can you try to use the attached file,
recompile RTK and then your software to check if this solves the
problem?
Thanks for the report and please don't hesitate to report your other
'shared libs option' bug.
Simon

On Fri, May 29, 2015 at 11:34 PM, Julia Mascolo-Fortin
<julia.mascolo-fortin.1 at ulaval.ca> wrote:
> Hi,
>
> I'm having a linking error with a RTK project when I include the file rtkLookupTableImageFilter.h (or any RTK file that includes it).
> If the #include is in the main.cxx, the program compiles and run, but if it's in any other source or header files, I see those errors:
>
> CMakeFiles/test.dir/main.cpp.o: In function `rtk::Functor::LUT<float, float>::operator()(float const&) const':
> main.cpp:(.text+0x0): multiple definition of `rtk::Functor::LUT<float, float>::operator()(float const&) const'
> CMakeFiles/test.dir/ReadingWriting.cpp.o:ReadingWriting.cpp:(.text+0x0): first defined here
> CMakeFiles/test.dir/main.cpp.o: In function `rtk::Functor::LUT<double, double>::operator()(double const&) const':
> main.cpp:(.text+0xd0): multiple definition of `rtk::Functor::LUT<double, double>::operator()(double const&) const'
> CMakeFiles/test.dir/ReadingWriting.cpp.o:ReadingWriting.cpp:(.text+0xd0): first defined here
>
>
> Also, when I comment the lines where the functions rtk::Functor::LUT<float, float>::operator()(float const&) const and rtk::Functor::LUT<double, double>::operator()(double const&) const are defined (lines 96 to 112) the program compiles juste fine.
>
> I use:
>
> OS: Linux (Mageia 2)
> Compiler: gcc 4.6.3
> ITK version: 4.5.1
> RTK version: the one downloaded from git on May 28 2015
>
> I have compiled RTK and ITK in Release mode and without the shared libs option (there's another bug if I try to put this option on).
>
>
>
> Thank you for any clue on how to solve the problem,
>
> Julia Mascolo-Fortin
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at public.kitware.com
> http://public.kitware.com/mailman/listinfo/rtk-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtkLookupTableImageFilter.h
Type: text/x-chdr
Size: 6508 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20150530/9dfc2c76/attachment-0010.h>


More information about the Rtk-users mailing list