Android make sdk出错问题的解决

编译Android SDK时遇到以下问题:

1. on-trivial designated initializers not supported

target thumb C++: gralloc.goldfish <= development/tools/emulator/opengl/system/gralloc/gralloc.cpp
development/tools/emulator/opengl/system/gralloc/gralloc.cpp: In function ‘int gralloc_unregister_buffer(const gralloc_module_t*, buffer_handle_t)‘:
development/tools/emulator/opengl/system/gralloc/gralloc.cpp:583:26: warning: converting to non-pointer type ‘int‘ from NULL [-Wconversion-null]
development/tools/emulator/opengl/system/gralloc/gralloc.cpp: At global scope:
development/tools/emulator/opengl/system/gralloc/gralloc.cpp:900:1: sorry, unimplemented: non-trivial designated initializers not supported
development/tools/emulator/opengl/system/gralloc/gralloc.cpp:900:1: warning: missing initializer for member ‘gralloc_module_t::reserved_proc‘ [-Wmissing-field-initializers]
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/gralloc.goldfish_intermediates/gralloc.o] Error 1


解决方法: 结构体的其中一个成员getphys未提供初始化,加上就ok了:

struct private_module_t HAL_MODULE_INFO_SYM = {
base: {
common: {
tag: HARDWARE_MODULE_TAG,
version_major: 1,
version_minor: 0,
id: GRALLOC_HARDWARE_MODULE_ID,
name: "Graphics Memory Allocator Module",
author: "The Android Open Source Project",
methods: &gralloc_module_methods,
dso: NULL,
reserved: {0, }
},
registerBuffer: gralloc_register_buffer,
unregisterBuffer: gralloc_unregister_buffer,
lock: gralloc_lock,
unlock: gralloc_unlock,
perform: NULL,
getphys: NULL,
reserved_proc : {NULL, }
}
};






Android make sdk出错问题的解决

上一篇:【.net core】微信公众号JSAPI支付--退款成功回调


下一篇:Android 学习(三)下: UI 控件