When _sbrk is not found this means that there is some function (most likely a C-library function) that is trying to allocate memory, but isn’t using malloc.
Here’s how to find out which function is causing the problem:
- add a function
extern "C" void* _sbrk() { return NULL; }to your program. This is only temporary and will fill in the missing function so the code links. - open the
user-part.lstfile that is produced alongside your compiled application code - search for
_sbrkto find which function is calling that. (It’s usually_malloc_r) - then search for
_malloc_rand see which function is calling that. That will tell you which function is trying to allocate memory directly via_malloc_rrather than via malloc()
Another approach, a little less direct, is to systematically remove pieces of your code until the program compiles, including/excluding pieces until you narrow down the exact line of code.
Once you find out which function is causing the linker error, please let me know and I’ll investigate how we can fix things.
Thanks 