Android make sdk出错问题的解决
编译Android SDK时遇到以下问题:
1. on-trivial designated initializers not supported
target thumb C++: gralloc.goldfish <= development/tools/emulator/opengl/system/gralloc/gralloc.cppdevelopment/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 supporteddevelopment/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, }}};
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。