sdk/emulator/opengl/system/gralloc/gralloc.cpp: In function 'int gralloc_unregister_buffer(const gralloc_module_t*, buffer_handle_t)':
sdk/emulator/opengl/system/gralloc/gralloc.cpp:512:26: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
sdk/emulator/opengl/system/gralloc/gralloc.cpp: At global scope:
sdk/emulator/opengl/system/gralloc/gralloc.cpp:818:1: sorry, unimplemented: non-trivial designated initializers not supported
sdk/emulator/opengl/system/gralloc/gralloc.cpp:818:1: sorry, unimplemented: non-trivial designated initializers not supported
sdk/emulator/opengl/system/gralloc/gralloc.cpp:818: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

Android를 make하다보니 위와 같은 에러가 뜬다.
구조체 중에 "getphys" 대한 항목이 빠져 발생하는 문제로 추가해주면된다.

$ sudo vi sdk/emulator/opengl/system/gralloc/gralloc.cpp

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


혹시나 위 방법으로 해결되지 않는다면 아래와 같이 입력한다.
global scope에서 값을 집어 넣을 경우 안되는 경우에 사용합니다.

struct private_module_t HAL_MODULE_INFO_SYM = {
    HARDWARE_MODULE_TAG,
    1,
    0,
    GRALLOC_HARDWARE_MODULE_ID,
    "Graphics Memory Allocator Module",
    "The Android Open Source Project",
    &gralloc_module_methods,
    NULL,
    {0, },
    gralloc_register_buffer,
    gralloc_unregister_buffer,
    gralloc_lock,
    gralloc_unlock,
    NULL,
    NULL,
    {NULL, }
};

+ Recent posts