简体   繁体   中英

android google play game services error : c++ symbol std::function couldn't be resolved

I'm using NDK-r9d and trying to integrate C++ Google Play Game (GPG) Services to my sample native-activity project. Now native-activity (sample from NDK ) compiles perfectly and runs fine on my android phone.

But when I add GPG using this code

gpg::AndroidPlatformConfiguration platform_configuration;
platform_configuration.SetActivity(state->activity->clazz);

I got error

"Symbol 'function' could not be resolved" at achievement_manager.h  /HelloJni/modules/gpg-cpp-sdk/android/include/gpg   line 54 Semantic Error

I've added includes to STL and everything needed from this link Eclipse indexer errors when using STL with Android NDK with no success.

This is my Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := hello-jni
LOCAL_SRC_FILES := hello-jni.cpp


LOCAL_STATIC_LIBRARIES := android_native_app_glue libgpg-1
LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv1_CM
LOCAL_CFLAGS := -std=c++11

include $(BUILD_SHARED_LIBRARY)

$(call import-add-path,$(LOCAL_PATH)/../modules)
$(call import-module,gpg-cpp-sdk/android)
$(call import-module,android/native_app_glue)

And this is my Application.mk

APP_PLATFORM := android-10
APP_ABI := armeabi-v7a
APP_STL := c++_static

Any suggestions?

I had some problems with compiling gpg sources until I specified the toolchain in Application.mk like this:

NDK_TOOLCHAIN_VERSION := 4.8

Note that I am on SDK 19, google play services 21, and NDK r9d.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM