copying function pointer throws error in one function pointer

55 views Asked by At

I have cjson code (https://github.com/kbranigan/cJSON/blob/master/ ) , it compiles well when I compile on the linux pc .

but when I compile for some embedded platform it throws error at

if (!hooks) { /* Reset hooks */
    cJSON_malloc = mem_alloc; // its equal to gcc malloc for the embedded compiler
    cJSON_free = mem_free; // its equal to gcc free
}

The error is Undefined reference to mem_alloc , and mem_free but if I call the function like below char* data = (char*) mem_alloc(32); it compiles well .. compiler is xtensa compiler(xt-xcc) isn't it right way to assign ?

0

There are 0 answers