[Rtk-users] Linking error with rtkLookupTableImageFilter.h

Julia Mascolo-Fortin julia.mascolo-fortin.1 at ulaval.ca
Fri May 29 17:34:43 EDT 2015


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


More information about the Rtk-users mailing list