2013-07-18 92 views
1

我有这样的错误,而与Android NDK编译,错误在编译时与Android NDK

错误日志

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) 

我能做些什么?

+0

是你的NDK ROOT是否正确定义?你有没有在Eclipse上测试演示? –

回答

0

错误很明显,您正在尝试使用与可用函数签名不匹配的sort函数上的参数。

您应该使用正确的参数调用sort函数!

+0

相同的代码是用xcode和cocos编译的,并且运行良好。 结构\t BoundingBoxCompare \t { \t \t布尔运算符()(常量的BoundingBox \t&B1,常量的BoundingBox \t&B2)常量 \t \t { \t \t \t如果(b1.x0 b2.x0) \t \t \t \t \t返回假; \t \t \t \t \t如果(b1.y0 user2595146