undefined reference to `sbrk'

Create new topics, add your comment, remark, bugs...
Post Reply
malife
Expert
Posts: 56
Joined: Tue Apr 17, 2007 7:24 am
Location: Santa Cruz, CA
Contact:

undefined reference to `sbrk'

Post by malife » Thu Aug 21, 2008 10:21 pm

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

Code: Select all

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
Expert
Posts: 56
Joined: Tue Apr 17, 2007 7:24 am
Location: Santa Cruz, CA
Contact:

Re: undefined reference to `sbrk'

Post by malife » Fri Aug 22, 2008 5:32 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest