Hi I have downloaded cocos for mac with framework and I tryed to start a new project. I ised cocos command line tool and generated the project. I tryed to compile using build_native but some error occours.
ccp-tests compiles well.
Here is my bash_profile:
# Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x
export COCOS_CONSOLE_ROOT=/Applications/Cocos/frameworks/cocos2d-x-3.8/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH
# Add environment variable COCOS_TEMPLATES_ROOT for cocos2d-x
export COCOS_TEMPLATES_ROOT=/librerieGiochi/cocos2d-x-3.5/templates
export PATH=$COCOS_TEMPLATES_ROOT:$PATH
# Add environment variable NDK_ROOT for cocos2d-x
export NDK_ROOT=/librerieGiochi/android-ndk-r9d
export PATH=$NDK_ROOT:$PATH
# Add environment variable ANDROID_SDK_ROOT for cocos2d-x
export ANDROID_SDK_ROOT=/librerieGiochi/android-sdk-macosx
export PATH=$ANDROID_SDK_ROOT:$PATH
export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
# Add environment variable ANT_ROOT for cocos2d-x
export ANT_ROOT=/Applications/Cocos/tools/ant/bin
export PATH=$ANT_ROOT:$PATH
# Add environment variable COCOS_FRAMEWORKS for cocos2d-x
export COCOS_FRAMEWORKS=/Applications/Cocos/frameworks
export PATH=$COCOS_FRAMEWORKS:$PATH
and this is the errors:
MacBook-Pro-di-Sephiroth:proj.android noidue$ python ./build_native.py
Please use cocos console instead.
Running command: compile
Building mode: debug
Using Eclipse project : /progetti/TestMyGame/TestMyGame/proj.android
Android platform not specified, searching a default one...
running: '/librerieGiochi/android-sdk-macosx/tools/android update project -t android-10 -p /progetti/TestMyGame/TestMyGame/proj.android'
Updated project.properties
Updated local.properties
Updated file /progetti/TestMyGame/TestMyGame/proj.android/proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
Building native...
NDK build mode: debug
NDK_TOOLCHAIN_VERSION: 4.8
running: '/librerieGiochi/android-ndk-r9d/ndk-build -C /progetti/TestMyGame/TestMyGame/proj.android -j8 NDK_MODULE_PATH=/Applications/Cocos/frameworks/cocos2d-x-3.8:/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos:/Applications/Cocos/frameworks/cocos2d-x-3.8/external NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1'
make: Entering directory `/progetti/TestMyGame/TestMyGame/proj.android'
[armeabi] StaticLibrary : libcpufeatures.a
[armeabi] Gdbserver : [arm-linux-androideabi-4.8] libs/armeabi/gdbserver
[armeabi] Gdbsetup : libs/armeabi/gdb.setup
[armeabi] SharedLibrary : libcocos2dcpp.so
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCActionNode.o):function std::vector<cocos2d::Vector<cocostudio::ActionFrame*>*, std::allocator<cocos2d::Vector<cocostudio::ActionFrame*>*> >::at(unsigned int): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmature.o):function cocostudio::Armature::drawContour(): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmature.o):function cocostudio::Armature::init(std::string const&): error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
/Applications/Cocos/frameworks/cocos2d-x-3.8/cocos/editor-support/cocostudio/prebuilt-mk/../../../../prebuilt/android/armeabi/libcocostudio.a(CCArmatureAnimation.o):function std::vector<std::string, std::allocator<std::string> >::_M_range_check(unsigned int) const: error: undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1
make: Leaving directory `/progetti/TestMyGame/TestMyGame/proj.android'
Error running command, return code: 2.
Traceback (most recent call last):
File "./build_native.py", line 43, in <module>
build(opts.build_mode)
File "./build_native.py", line 28, in build
raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!")
Exception: Build dynamic library for project [ /progetti/TestMyGame/TestMyGame/proj.android/../ ] fails!
can You give a hint?
thanks