1

I have this error, while compiling with android NDK,

ERROR LOG

error: no matching function for call to 'sort(std::vector<BoundingBox>::iterator, std::vector<BoundingBox>::iterator, CPlayerScoreLabelEntityManager::PostEnterLevelNewEntitySpawned(EntityInfo*, CGameEntity*)::BoundingBoxCompare)'
jni/../../Classes/grannygamelib/CEntityManager.cpp:2695:65: note: candidates are:
/Users/developer2/Documents/PROGRAMMI/ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_algo.h:5431:5: note: template<class _RAIter> void std::sort(_RAIter, _RAIter)
/Users/developer2/Documents/PROGRAMMI/ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_algo.h:5467:5: note: template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)

What can i do ?

asloob
  • 1,308
  • 20
  • 34

1 Answers1

0

The error is clear, you are trying to use parameters on sort function that are not matching the available function signature.

You should call the sort function with the correct parameters!

thiagolr
  • 6,909
  • 6
  • 44
  • 64
  • The same code is compiled with xcode and cocos , and work well. struct BoundingBoxCompare { bool operator ()(const BoundingBox &b1, const BoundingBox &b2) const { if ( b1.x0 < b2.x0 ) return true; if ( b1.x0 > b2.x0 ) return false; if ( b1.y0 < b2.y0 ) return true; return false; } }; sort( b_boxes.begin(), b_boxes.end(), BoundingBoxCompare() ); – user2595146 Jul 18 '13 at 13:33