SPC5Studio cannot use the malloc() and free() functions in the stdlib.h standard library.
SPC5Studio cannot use the malloc() and free() functions in the stdlib.h standard library.
For Example:
char * str = (char *) malloc(1024);
free(str);
I've added the GCC standard header path to SPC5Studio, and other library functions are used normally, and I can't compile through when using the malloc function, reporting the following error:
c:/spc5studio/eclipse/plugins/com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.20190604105544/toolchain/bin/../lib/gcc/powerpc-eabivle/4.9.4/../../../../powerpc-eabivle/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0x1a): undefined reference to `sbrk'
collect2.exe: error: ld returned 1 exit status
make: *** [build/out.elf] Error 1
How do I solve the problem that malloc and free are not available, or how do I dynamically allocate memory in SPC5Studio?
Thank you.
