我想在Raspberry Pi上使用带有Eigen的ChibiOS,但是当我包含Eigen库时,我得到一个错误:
Linking build/ch.elf
/opt/arm_gcc/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x18): undefined reference to `_sbrk'
collect2: error: ld returned 1 exit status
make: *** [build/ch.elf] Error 1我正在使用Sourcery Lite4.7.2交叉编译器,这是CodeBench命令:
arm-none-eabi-gcc -c -mcpu=arm7tdmi -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -ffunction-sections -fdata-sections -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/ -mno-thumb-interwork -MD -MP -MF .dep/build.d -I. -I../../os/ports/GCC/ARM -I../../os/ports/GCC/ARM/BCM2835 -I../../os/kernel/include -I../../os/hal/include -I../../os/hal/platforms/BCM2835 -I../../boards/RASPBERRYPI_MODB -I../../os/various -I../../os/contrib -I../../Eigen main.c -o main.o如何修复此错误?
发布于 2012-11-22 06:23:12
函数_sbrk听起来非常像用于内存分配的系统调用。您确定您的目标系统支持sbrk(2)系统调用吗?在任何情况下,询问_sbrk和Raspberry Pi可能会得到更好的结果。你可能想检查一下this question,这似乎也是一个类似的问题。
https://stackoverflow.com/questions/13501898
复制相似问题