简体   繁体   English

错误:在Android应用中集成Breakpad时出现预期的嵌套名称说明符错误

[英]error: expected nested-name-specifier error is coming on integrating Breakpad in android app

I was following the steps given in URL: https://github.com/ashtom/breakapp/blob/master/README.md to test a sample hockey app with Breakpad integration, however i am getting the following error on executing the Step 4 (ndk-build). 我正在按照URL中给出的步骤进行操作: https : //github.com/ashtom/breakapp/blob/master/README.md以测试具有Breakpad集成的示例曲棍球应用程序,但是执行步骤4时出现以下错误(ndk-build)。

I have the following configuration: Mac OSX 10.10.5 and android-ndk-r10e-darwin-x86_64.bin. 我有以下配置:Mac OSX 10.10.5和android-ndk-r10e-darwin-x86_64.bin。

[armeabi] Compile++ arm  : breakpad_client <= log.cc
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:7: error: expected nested-name-specifier before 'AndroidLogBufferWriteFunc'
using AndroidLogBufferWriteFunc = int (*)(int bufID, int prio, const char *tag,
   ^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:7: error: 'AndroidLogBufferWriteFunc' has not been declared
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:33: error: expected ';' before '=' token
using AndroidLogBufferWriteFunc = int (*)(int bufID, int prio, const char *tag,
                             ^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:47:33: error: expected unqualified-id before '=' token
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:53:1: error: 'AndroidLogBufferWriteFunc' does not name a type
AndroidLogBufferWriteFunc g_android_log_buf_write = nullptr;
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc: In function 'void logger::initializeCrashLogWriter()':
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:3: error: 'g_android_log_buf_write' was not declared in this scope
g_android_log_buf_write = reinterpret_cast<AndroidLogBufferWriteFunc>(
^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: expected type-specifier before 'AndroidLogBufferWriteFunc'
g_android_log_buf_write = reinterpret_cast<AndroidLogBufferWriteFunc>(
                                          ^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: expected '>' before 'AndroidLogBufferWriteFunc'
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: expected '(' before 'AndroidLogBufferWriteFunc'
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:60:46: error: 'AndroidLogBufferWriteFunc' was not declared in this scope
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:61:54: error: expected ')' before ';' token
   dlsym(RTLD_DEFAULT, "__android_log_buf_write"));
                                                  ^
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc: In function 'int logger::writeToCrashLog(const char*)':
jni/../../breakpad/android/google_breakpad/../../src/client/linux/log/log.cc:68:7: error: 'g_android_log_buf_write' was not declared in this scope
if (g_android_log_buf_write) {
   ^
make: *** [obj/local/armeabi/objs/breakpad_client/src/client/linux/log/log.o] Error 1

I think you should enable c++11 support on ndk to compile your app. 我认为您应该在ndk上启用c ++ 11支持以编译您的应用程序。

put option in Application.mk 在Application.mk中放置选项

APP_CPPFLAGS += -std=c++11

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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