#163 [IT++ 4.0.0] converters.cpp does not compile with GCC 3.3.x

release_4.0.x
closed
5
2012-09-15
2007-10-23
M. Sean Finney
No

g++ -DHAVE_CONFIG_H -I. -I../../itpp -I../.. -I../.. -DNDEBUG -I/<path_to_itpp_external>/include -O3 -pipe -MT libbase_la-converters.lo -MD -MP -MF .deps/libbase_la-converters.Tpo -c ../../itpp/base/converters.cpp -o libbase_la-converters.o
../../itpp/base/converters.cpp:215: error: duplicate explicit instantiation of
`itpp::ivec itpp::to_ivec(const itpp::Vec<T>&) [with T = itpp::bin]'
make[4]: *** [libbase_la-converters.lo] Error 1

fwiw, it compiles just fine with gcc 3.4.2. If this is a compiler bug and/or you don't want to support 3.3.2, feel free to reject the bug, and i will tell the appropriate people here that it's time to bite the bullet and move along to a new compiler version :)

sean

Discussion

  • M. Sean Finney
    M. Sean Finney
    2007-10-23

    Logged In: YES
    user_id=226838
    Originator: YES

    just fyi, commenting out line 215 fixes the problem, and itpp then compiles without any errors/problems. in converters.h, which is included by converters.cpp, we have "ivec to_ivec(const Vec<T> &v)" defined, so i guess the problem is that gcc 3.3.2 instantiates it there, whereas gcc >= 3.4.2 doesn't ? my knowledge in the arcane arts of template instantiation is somewhat lacking, so i don't know if this is a valid problem or a compiler bug...

     
  • Logged In: YES
    user_id=1004597
    Originator: NO

    The workaround I proposed is now in our SVN repository. It will be a part of the next bug fix release 4.0.1.

    BR,
    /ediap