【问题标题】:Error after building a testcpp Eclipse Project构建 testcpp Eclipse 项目后出错
【发布时间】:2014-09-11 00:05:15
【问题描述】:

我正在尝试按照本指南为 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/Downloads/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:静态库始终忽略 LOCAL_LDLIBS
make: 进入目录/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 等”,除了 LabelReader 文件夹是空的之外,都带有同名的“.o”和“.od”文件。

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

Makefile. How to exclude one particular file from compilation?

但是似乎有多种方法可以这样做,但我仍然不确定我是否完全理解出了什么问题,除了有一个正在编译但无法构建的丢失文件。如果这个问题也很抱歉很大,这也是我在这里的第一个问题,如果我写了很多,请见谅。

【问题讨论】:

  • 有人可以帮我解决这个问题吗?

标签: android c++ eclipse android-ndk cocos2d-x


【解决方案1】:

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

#include <algorithm>

【讨论】:

  • 谢谢。将此行添加到 LabelReader.cpp 作品中。
  • 对我也有用 -->cocos2dx2.2 和 eclipse ->juno .谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-14
相关资源
最近更新 更多