Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> Android make sdk出錯問題的解決

Android make sdk出錯問題的解決

編輯:關於Android編程

編譯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, }    }};






  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved