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

标签 android c++ compiler-construction android-source

我正在尝试为我的设备编译 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();
    }
}

谢谢。

最佳答案

似乎您需要包含 #include <cutils/tztime.h>

关于android - 编译android源代码时出现C++错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11739310/

相关文章:

java - viewPager 上的 RecyclerView 崩溃

android - 谷歌地图显示不正确,只显示网格

c++ - 为什么编译 VCC .sln 在没有标准输出的情况下在后台运行?

c++ - STL 中的写时复制支持

java - 显示照片内存不足

android - React native 构建失败 : The development server returned response error code 500

c++ - 为什么此条件运算符的计算结果为 int?

c++ - 为什么 unsigned int 在最后一次迭代时崩溃循环?

c++ - C++ 中多线程的 join() 和 detach() 有什么不同?

c++ - Visual Studio 2012 : Compiler setup (possible to use Compiler from SDK eg. VC++2008-编译器 VC++2010-编译器)