On Wed, 11 Apr 2012 13:23:00 -0500 "David C. Rankin" drankinatty@suddenlinkmail.com wrote:
c/c++ <stl> folks,
I have tried to fix rosegarden in a manner similar to the other packages that rely on stl by adding the 'this->' where the errors said. I have done that, but now the build fails complaining that:
Rosegarden::Segment, true>::PitchGreater' has no member named 'getAsEvent'
Apparently, gcc47 doesn't accept the instantation in the same way gcc46 did. rosegarden built fine with gcc46.
The patch I applied to Sets.h to fix the 'this->' complaints is attached. The error (with -fpermissive given) is:
[ 6%] Building CXX object src/CMakeFiles/RosegardenCommands-static.dir/commands/notation/AddFingeringMarkCommand.cpp.o
cd /build/src/build/src
&& /usr/bin/c++ -DHAVE_XFT -DHAVE_ALSA -DHAVE_LIBJACK -DHAVE_DSSI -DHAVE_LIBLO -DHAVE_LIBLRDF -DHAVE_LADSPA -DHAVE_FFTW3F -DHAVE_CONFIG_H -fpermissive -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -O2 -w -fexceptions -DNDEBUG -include tqt.h -I/opt/tqt3/include -I/usr/include/tqt -I/opt/trinity/include -I/build/src/build -I/build/src/build/src -I/build/src/rosegarden/src -I/build/src/rosegarden/src/base -I/usr/include/alsa -I/usr/include/freetype2 -I/usr/include/raptor2 -D'VERSION="1.7.0"' -o CMakeFiles/RosegardenCommands-static.dir/commands/notation/AddFingeringMarkCommand.cpp.o -c /build/src/rosegarden/src/commands/notation/AddFingeringMarkCommand.cpp In file included from /build/src/rosegarden/src/commands/notation/AddFingeringMarkCommand.cpp:33:0: /build/src/rosegarden/src/base/Sets.h: In instantiation of 'bool Rosegarden::GenericChord<Element, Container, singleStaff>::PitchGreater::operator()(const Iterator&, const singleStaff>Iterator&) [with Element = Rosegarden::Event; Container = Rosegarden::Segment; bool singleStaff = true; Rosegarden::GenericChord<Element, Container, singleStaff>::Iterator = singleStaff>std::_Rb_tree_const_iteratorRosegarden::Event*]':
/usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_algo.h:2142:4: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::_Rb_tree_const_iteratorRosegarden::Event**, std::vector<std::_Rb_tree_const_iteratorRosegarden::Event* > >; _Compare = Rosegarden::GenericChordRosegarden::Event, Rosegarden::Segment, true::PitchGreater]' /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_algo.h:3492:4: required from 'void std::__inplace_stable_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::_Rb_tree_const_iteratorRosegarden::Event**, std::vector<std::_Rb_tree_const_iteratorRosegarden::Event* > >; _Compare = Rosegarden::GenericChordRosegarden::Event, Rosegarden::Segment, true::PitchGreater]' /usr/lib/gcc/i686-pc-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_algo.h:5683:2: required from 'void std::stable_sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::_Rb_tree_const_iteratorRosegarden::Event**, std::vector<std::_Rb_tree_const_iteratorRosegarden::Event* > >; _Compare = Rosegarden::GenericChordRosegarden::Event, Rosegarden::Segment, true::PitchGreater]' /build/src/rosegarden/src/base/Sets.h:386:9: required from 'Rosegarden::GenericChord<Element, Container, singleStaff>::GenericChord(Container&, singleStaff>Rosegarden::GenericChord<Element, Container, singleStaff>::Iterator, const Rosegarden::Quantizer*, Rosegarden::PropertyName) [with Element = Rosegarden::Event; Container = Rosegarden::Segment; bool singleStaff = true; Rosegarden::GenericChord<Element, Container, singleStaff>::Iterator = std::_Rb_tree_const_iteratorRosegarden::Event*]' /build/src/rosegarden/src/commands/notation/AddFingeringMarkCommand.cpp:76:69: required from here /build/src/rosegarden/src/base/Sets.h:680:70: error: 'class Rosegarden::GenericChord<Rosegarden::Event, Rosegarden::Segment, true>::PitchGreater' has no member named 'getAsEvent' /build/src/rosegarden/src/base/Sets.h:681:70: error: 'class Rosegarden::GenericChord<Rosegarden::Event, Rosegarden::Segment, true>::PitchGreater' has no member named 'getAsEvent' /usr/bin/cmake -E cmake_progress_report /build/src/build/CMakeFiles [ 6%] Building CXX object src/CMakeFiles/RosegardenCommands-static.dir/commands/notation/AddIndicationCommand.cpp.o cd /build/src/build/src && /usr/bin/c++ -DHAVE_XFT -DHAVE_ALSA -DHAVE_LIBJACK -DHAVE_DSSI -DHAVE_LIBLO -DHAVE_LIBLRDF -DHAVE_LADSPA -DHAVE_FFTW3F -DHAVE_CONFIG_H -fpermissive -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -O2 -w -fexceptions -DNDEBUG -include tqt.h -I/opt/tqt3/include -I/usr/include/tqt -I/opt/trinity/include -I/build/src/build -I/build/src/build/src -I/build/src/rosegarden/src -I/build/src/rosegarden/src/base -I/usr/include/alsa -I/usr/include/freetype2 -I/usr/include/raptor2 -D'VERSION="1.7.0"' -o CMakeFiles/RosegardenCommands-static.dir/commands/notation/AddIndicationCommand.cpp.o -c /build/src/rosegarden/src/commands/notation/AddIndicationCommand.cpp make[2]: *** [src/CMakeFiles/RosegardenCommands-static.dir/commands/notation/AddFingeringMarkCommand.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/build/src/build' make[1]: *** [src/CMakeFiles/RosegardenCommands-static.dir/all] Error 2 make[1]: Leaving directory `/build/src/build' make: *** [all] Error 2
I have no idea how to chase this error through the stl container, etc....
getAsEvent here is a static member function of AbstractSet, this is why this-> doesn't work. Here getAsEvent(x) can be changed to AbstractSet::getAsEvent(x) (there is no reference to an actual AbstractSet since the member function is static). If it still doesn't work (I'm not a template guru...) you can also try AbstractSet<Element,Container>::getAsEvent(x).