构建Pebble watchapp时对'_sbrk'的未定义引用

问题描述 投票:2回答:2

有时我的Pebble watchapp拒绝构建并给出了不友好的错误消息:

$ pebble build
[...]
[ 9/13] cprogram: build/src/project_lift.c.7.o build/appinfo.auto.c.7.o -> build/pebble-app.elf
/Users/Pavlo/pebble-dev/PebbleSDK-2.0.1/arm-cs-tools/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
/Users/thomas/work/arm-eabi-toolchain/build/newlib/arm-none-eabi/thumb2/newlib/libc/reent/../../../../../../../newlib-2012.09/newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
collect2: error: ld returned 1 exit status

我与sbrkr.c没有直接关系。我发现这是由我的应用程序中的特定代码行引起的。我能否获得更简洁的错误消息(例如调用栈)?

c pebble-watch pebble-sdk
2个回答
3
投票

[您正在尝试链接到Pebble不支持的功能,例如printfsprintffopen等。请确保您正在调用的功能在Pebble api文档中列出。


0
投票

How to find C++ language constructs allocating dynamic memory?的答案很有用。向ld添加--cref选项,然后检查映射文件。

© www.soinside.com 2019 - 2024. All rights reserved.