使用 Cocos-2dx 和 Clang 构建时,我在 Android NDK 中不断收到以下错误
jni/../../Classes/Facebook/FacebookConstants.h:44:14: error: no type named 'function' in namespace 'std'
typedef std::function<void()> FacebookLoginCallback;
TApplication.mk
NDK_TOOLCHAIN_VERSION := clang
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1
安卓.mk
LOCAL_CFLAGS :=-D__GXX_EXPERIMENTAL_CXX0X__
LOCAL_CPPFLAGS := -std=c++11
LOCAL_CFLAGS += -std=gnu++11
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := game_shared
LOCAL_MODULE_FILENAME := libgame
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/Facebook/Request.cpp \
../../Classes/FriendListCell.cpp \
../../Classes/Game.cpp \
../../Classes/GameListCell.cpp \
../../Classes/GameListHeaderCell.cpp \
../../Classes/GameScene.cpp \
../../Classes/LoginScene.cpp \
../../Classes/MenuScene.cpp \
../../Classes/NewGameScene.cpp \
../../Classes/Parse/curl/docs/examples/asiohiper.cpp \
../../Classes/Parse/curl/docs/examples/htmltitle.cpp \
../../Classes/Parse/HTTP.cpp \
../../Classes/Parse/lib_json/json_reader.cpp \
../../Classes/Parse/lib_json/json_value.cpp \
../../Classes/Parse/lib_json/json_writer.cpp \
../../Classes/Parse/ParseHTTP.cpp \
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes \
$(LOCAL_PATH)/../../Classes/Parse \
$(LOCAL_PATH)/../../Classes/Parse/json \
$(LOCAL_PATH)/../../Classes/Parse/lib_json \
$(LOCAL_PATH)/../../Classes/Facebook \
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,CocosDenshion/android) \
$(call import-module,cocos2dx) \
$(call import-module,extensions)