0
我想在我的Android應用程序使用libbacktrace,我不知道如何構建它... ...構建libbacktrace爲Android
現在我試圖建立由腳本的lib:
#!/bin/bash
ndk-build \
APP_BUILD_SCRIPT=libbacktrace/Android.mk \
NDK_PROJECT_PATH=. \
APP_STL=stlport_static \
LOCAL_C_INCLUDES+=include \
LOCAL_C_INCLUDES+=../../../android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/include \
LOCAL_C_INCLUDES+=../../../android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include/ \
APP_PLATFORM=android-19
,我有錯誤:
[armeabi] Compile++ thumb: backtrace <= BacktraceImpl.cpp
libbacktrace/BacktraceImpl.cpp: In member function 'virtual std::string Backtrace::FormatFrameData(const backtrace_frame_data_t*)':
libbacktrace/BacktraceImpl.cpp:117:48: error: expected ')' before 'PRIxPTR'
snprintf(buf, sizeof(buf), "#%02zu pc %0*" PRIxPTR " %s (%s+%" PRIuPTR ")",
^
libbacktrace/BacktraceImpl.cpp:119:58: error: conversion lacks type at end of format [-Werror=format=]
frame->func_name.c_str(), frame->func_offset);
^
libbacktrace/BacktraceImpl.cpp:119:58: error: too many arguments for format [-Werror=format-extra-args]
libbacktrace/BacktraceImpl.cpp:121:48: error: expected ')' before 'PRIxPTR'
snprintf(buf, sizeof(buf), "#%02zu pc %0*" PRIxPTR " %s (%s)", frame->num,
^
libbacktrace/BacktraceImpl.cpp:122:87: error: conversion lacks type at end of format [-Werror=format=]
(int)sizeof(uintptr_t)*2, relative_pc, map_name, frame->func_name.c_str());
^
libbacktrace/BacktraceImpl.cpp:122:87: error: too many arguments for format [-Werror=format-extra-args]
libbacktrace/BacktraceImpl.cpp:124:48: error: expected ')' before 'PRIxPTR'
snprintf(buf, sizeof(buf), "#%02zu pc %0*" PRIxPTR " %s", frame->num,
^
libbacktrace/BacktraceImpl.cpp:125:61: error: conversion lacks type at end of format [-Werror=format=]
(int)sizeof(uintptr_t)*2, relative_pc, map_name);
^
libbacktrace/BacktraceImpl.cpp:125:61: error: too many arguments for format [-Werror=format-extra-args]
cc1plus: all warnings being treated as errors
make: *** [obj/local/armeabi/objs/backtrace/BacktraceImpl.o] Error 1
我明白,我做錯了什麼,但我不知道是什麼...