编译android源代码时出现C++错误

问题描述 投票:0回答:1

我正在尝试为我的设备编译 android 4.1,但出现此错误:

target thumb C++: libandroid_runtime <= frameworks/base/core/jni/Time.cpp
target thumb C++: libandroid_runtime <= frameworks/base/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
frameworks/base/core/jni/Time.cpp: In member function 'android::String8 android::Time::format(char const*, const android::strftime_locale*) const':
frameworks/base/core/jni/Time.cpp:91:61: error: 'strftime_tz' was not declared in this scope
make: *** [out/target/product/galaxysl/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/Time.o] Errore 1
make: *** Attesa per i processi non terminati....

我该如何解决这些问题?我必须在 Time.cpp 中声明 strftime_tz 但我不知道该怎么做。其中有Time.cpp的部分:

String8 
Time::format(const char *format, const struct strftime_locale *locale) const
{
    char buf[257];
    int n = strftime_tz(buf, 257, format, &(this->t), locale);
    if (n > 0) {
        return String8(buf);
    } else {
        return String8();
    }
}

谢谢。

android c++ android-source
1个回答
0
投票

似乎你需要包括

#include <cutils/tztime.h>

© www.soinside.com 2019 - 2024. All rights reserved.