./build_native.py
を実行すると、下記のエラーとなります。
lang
1We will remove this script next version,you should use cocos console to build android project. 2 3The Selected NDK toolchain version was 4.8 ! 4make: Entering directory `/Users/apple/work/myprojects/tekijo/proj.android' 5[armeabi] Compile++ thumb: cocos2dcpp_shared <= main.cpp 6[armeabi] Compile++ thumb: cocos2dcpp_shared <= AppDelegate.cpp 7[armeabi] Compile++ thumb: cocos2dcpp_shared <= AudioUtils.cpp 8[armeabi] Compile++ thumb: cocos2dcpp_shared <= ChangeScene.cpp 9In file included from jni/../../cocos2d/cocos/3d/../base/ccMacros.h:35:0, 10 from jni/../../cocos2d/cocos/3d/../base/CCRefPtr.h:30, 11 from jni/../../cocos2d/cocos/3d/../cocos2d.h:42, 12 from jni/../../Classes/AppDelegate.h:4, 13 from jni/hellocpp/main.cpp:1: 14jni/../../cocos2d/cocos/3d/../base/CCConsole.h:42:18: fatal error: thread: No such file or directory 15 #include <thread> 16 ^ 17compilation terminated. 18In file included from jni/../../cocos2d/cocos/3d/../base/ccMacros.h:35:0, 19 from jni/../../cocos2d/cocos/3d/../base/CCRefPtr.h:30, 20 from jni/../../cocos2d/cocos/3d/../cocos2d.h:42, 21 from jni/../../Classes/AppDelegate.h:4, 22 from jni/../../Classes/AppDelegate.cpp:1: 23jni/../../cocos2d/cocos/3d/../base/CCConsole.h:42:18: fatal error: thread: No such file or directory 24 #include <thread> 25 ^ 26compilation terminated. 27In file included from jni/../../cocos2d/cocos/3d/../base/ccMacros.h:35:0, 28 from jni/../../cocos2d/cocos/3d/../base/CCRefPtr.h:30, 29 from jni/../../cocos2d/cocos/3d/../cocos2d.h:42, 30 from jni/../../Classes/ChangeScene.h:12, 31 from jni/../../Classes/ChangeScene.cpp:9: 32jni/../../cocos2d/cocos/3d/../base/CCConsole.h:42:18: fatal error: thread: No such file or directory 33 #include <thread> 34 ^ 35compilation terminated. 36make: *** [obj/local/armeabi/objs-debug/cocos2dcpp_shared/__/__/Classes/AppDelegate.o] Error 1 37make: *** Waiting for unfinished jobs.... 38make: *** [obj/local/armeabi/objs-debug/cocos2dcpp_shared/hellocpp/main.o] Error 1 39make: *** [obj/local/armeabi/objs-debug/cocos2dcpp_shared/__/__/Classes/ChangeScene.o] Error 1 40In file included from jni/../../cocos2d/cocos/3d/../base/ccMacros.h:35:0, 41 from jni/../../cocos2d/cocos/3d/../base/CCRefPtr.h:30, 42 from jni/../../cocos2d/cocos/3d/../cocos2d.h:42, 43 from jni/../../Classes/AudioUtils.cpp:10: 44jni/../../cocos2d/cocos/3d/../base/CCConsole.h:42:18: fatal error: thread: No such file or directory 45 #include <thread> 46 ^ 47compilation terminated. 48make: *** [obj/local/armeabi/objs-debug/cocos2dcpp_shared/__/__/Classes/AudioUtils.o] Error 1 49make: Leaving directory `/Users/apple/work/myprojects/tekijo/proj.android' 50Traceback (most recent call last): 51 File "./build_native.py", line 149, in <module> 52 build(opts.ndk_build_param,opts.android_platform,opts.build_mode) 53 File "./build_native.py", line 134, in build 54 do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode) 55 File "./build_native.py", line 70, in do_build 56 raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") 57Exception: Build dynamic library for project [ /Users/apple/work/myprojects/tekijo/proj.android ] fails!
cocosライブラリ?にて
include <thread> ができていないようです。
Android.mkは下記のように修正しています。
lang
1LOCAL_PATH := $(call my-dir) 2 3include $(CLEAR_VARS) 4 5$(call import-add-path,$(LOCAL_PATH)/../../cocos2d) 6$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external) 7$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos) 8 9LOCAL_MODULE := cocos2dcpp_shared 10 11LOCAL_MODULE_FILENAME := libcocos2dcpp 12 13# 追加分 14CPP_FILES := $(shell find $(LOCAL_PATH)/../../Classes -name *.cpp) 15LOCAL_SRC_FILES := hellocpp/main.cpp 16LOCAL_SRC_FILES += $(CPP_FILES:$(LOCAL_PATH)/%=%) 17LOCAL_C_INCLUDES := $(shell find $(LOCAL_PATH)/../../Classes -type d) 18 19#LOCAL_SRC_FILES := hellocpp/main.cpp ¥ 20# ../../Classes/AppDelegate.cpp ¥ 21# ../../Classes/HelloWorldScene.cpp 22 23#LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes 24 25LOCAL_STATIC_LIBRARIES := cocos2dx_static 26LOCAL_STATIC_LIBRARIES += cocosdenshion_static 27 28include $(BUILD_SHARED_LIBRARY) 29 30$(call import-module,.) 31$(call import-module,audio/android)
ここ2日ほど悩んでいますが、どうにもわからず質問させてただきました。
なにかしらヒントでも結構ですので宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。