FORUM TOPIC · READ ONLY

undefined reference to `sbrk'

undefined reference to `sbrk'

Forum : General Remark and Questions

2 message(s) · archive en lecture seule

malife
Hello Lubin,

I've spent much of the day today trying to debug this error with no luck:


<i>
</i>C:\PROGRA~1\MICROC~1\MPLABC~1\lib\libc-coff.a(xgetmem.o)(.libc+0x4):/home/guymc/build/3.10/build_20080424/src/standardc/sxl/xgetmem.c: undefined reference to `sbrk' 
C:\Program Files\Microchip\MPLAB C30\bin\bin/pic30-coff-ld.exe: link errors found, deleting executable `..\../GPSRead.coff' 
gmake: *** [..\../GPSRead.coff] Error 0xff 
### Real-Time Workshop build procedure for model: 'GPSRead' aborted due to an error.


The strange thing is that it happens once the memory usage map has been printed, that is almost at the end.



Any idea what the problem might be?



Thanks!
malife

Re: undefined reference to `sbrk'

I finally solved this issue. It turns out that malloc and memcpy use sbrk which for some reason it is not compiled into the coff. Anyways, I found in the periphereal library documentation that microchip provides the source for sbrk with the standard C30 instalation, so I just added the source to the Simulink project and then it compiled fine.



Hope this helps anyone with similar problems