user3857450
user3857450

Reputation: 21

Error after building a testcpp Eclipse Project

I am trying to build and run a test project for android following this guide :

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

The specific problem is after building the Test demo in eclipse which is called "TestCpp" which has another project linked to it "libcocos2dx" i get an error stating:

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

This is what the console displayed through the build process:

**** Build of configuration Default for project 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 Using prebuilt externals Android NDK: WARNING:/Users/mohammadbaroudi/Downloads/cocos2d-x-2.2.5/samples/Cpp/TestCpp/proj.android/../../../../cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
make: Entering directory /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'

**** Build Finished ****

Now I checked the file path and it pointed to a non-existing obj file "LabelReader.o", the strange thing is that in the "/WidgetReader" folder "mentioned in the error above", there are multiple reader folders e.g:"ButtonReader,CheckBoxReader,etc" all with accompanying ".o" & ".o.d" files with the same names except for the LabelReader folder which is empty.

I tried to exclude the "LabelReader.o" file from the build process through right clicking on the file in eclipse and excluding it, but the same error occurred and I tried to right click on the error in the problems tab and hit "fix" which notified me that it cant fix it.The last thing that came to mind was excluding the "LabelReader.o" file from compilation through modifying the makefile itself, where its discussed here:

Makefile. How to exclude one particular file from compilation?

But there seemed to be multiple methods of doing so, and still i am not sure i completely understand whats wrong other than there is a missing file thats being complied but can't be built.I am sorry if this question is too big and it also is my first question here so excuse me if i wrote a lot.

Upvotes: 2

Views: 1166

Answers (1)

kokos
kokos

Reputation: 101

add this line in file where error occurred

#include <algorithm>

Upvotes: 10

Related Questions