【问题标题】:android google play game services error : c++ symbol std::function couldn't be resolvedandroid google play 游戏服务错误:c++ 符号 std::function 无法解析
【发布时间】:2014-10-14 17:35:47
【问题描述】:

我正在使用 NDK-r9d 并尝试将 C++ Google Play 游戏 (GPG) 服务集成到我的示例原生活动项目中。 现在 native-activity(来自 NDK 的示例)完美编译并在我的 android 手机上运行良好。

但是当我使用此代码添加 GPG 时

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

我有错误

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

我已将包含添加到 STL 以及此链接 Eclipse indexer errors when using STL with Android NDK 所需的所有内容,但没有成功。

这是我的 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)

这是我的 Application.mk

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

有什么建议吗?

【问题讨论】:

  • 请向我们展示更多代码,第 54 行是什么? “无法解析符号‘功能’”,位于成就管理器.h /HelloJni/modules/gpg-cpp-sdk/android/include/gpg 第 54 行

标签: android android-ndk google-play-services google-play-games


【解决方案1】:

在我像这样在 Application.mk 中指定工具链之前,我在编译 gpg 源代码时遇到了一些问题:

NDK_TOOLCHAIN_VERSION := 4.8

请注意,我使用的是 SDK 19、google play services 21 和 NDK r9d。

【讨论】:

    猜你喜欢
    • 2016-07-28
    • 1970-01-01
    • 1970-01-01
    • 2014-07-08
    • 2014-04-17
    • 2017-06-13
    • 2013-05-18
    • 2013-12-20
    相关资源
    最近更新 更多