2013-07-18 91 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