构建testcpp Eclipse项目后出错

use*_*450 2 c++ eclipse android android-ndk cocos2d-x

我正在尝试按照本指南构建并运行android的测试项目:

" http://www.cocos2d-x.org/wiki/Setting_up_Android_Development_Environment_on_Mac_OSX#Get-the-NDK "

具体问题是在eclipse中构建测试演示之后称为"TestCpp",其中有另一个项目链接到它"libcocos2dx"我得到一个错误说明:

make:***[obj/local/armeabi/objs/cocos_extension_static/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.o]错误1

这是控制台通过构建过程显示的内容:

****构建配置项目TestCpp的默认值****

bash /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/build_native.sh NDK_ROOT =/Users/mohammadbaroudi/Downloads/android-ndk-r10 COCOS2DX_ROOT =/Users/mohammadbaroudi /下载/ cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android /../../../ .. APP_ROOT = /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/ Cpp/TestCpp/proj.android/.. APP_ANDROID_ROOT = /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android使用预构建的外部Android NDK:警告:/ Users/mohammadbaroudi/Downloads /cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../../cocos2dx/Android.mk:cocos2dx_static:对于静态库
make,总是忽略LOCAL_LDLIBS :进入目录/Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android' [armeabi] Compile++ thumb: cocos_extension_static <= LabelReader.cpp /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../../extensions/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.cpp: In member function 'virtual void cocos2d::extension::LabelReader::setPropsFromJsonDictionary(cocos2d::ui::Widget*, const Value&)': /Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../../extensions/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.cpp:54:9: error: 'transform' is not a member of 'std' std::transform(file_extension.begin(),file_extension.end(), file_extension.begin(), (int(*)(int))toupper); ^ make: *** [obj/local/armeabi/objs/cocos_extension_static/CocoStudio/Reader/WidgetReader/LabelReader/LabelReader.o] Error 1 make: Leaving directory/Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android"

****建成品****

现在我检查了文件路径,它指向一个不存在的obj文件"LabelReader.o",奇怪的是在"/ WidgetReader"文件夹"上面的错误中提到",有多个读者文件夹,例如:" ButtonReader,CheckBoxReader等"所有附带".o"和".od"文件的名称相同,但LabelReader文件夹为空.

我试图通过在eclipse中右键单击文件并排除它来从构建过程中排除"LabelReader.o"文件,但是发生了同样的错误,我试图右键单击问题选项卡中的错误并点击"修复"通知我它无法修复它.最后想到的是通过修改makefile本身从编译中排除"LabelReader.o"文件,其中讨论了这里:

Makefile文件.如何从编译中排除一个特定文件?

但似乎有多种方法这样做,但我仍然不确定我完全理解什么是错的,除了有一个丢失的文件被编译但无法构建.我很抱歉,如果这个问题太大而且它这也是我的第一个问题,请原谅我,如果我写了很多.

小智 10

在发生错误的文件中添加此行

#include <algorithm>
Run Code Online (Sandbox Code Playgroud)