rt-thread studio编译出错undefined reference to `rt_malloc'的处理方法

电子说

1.2w人已加入

描述

刚开始学习RT-ThreadStudio,创建了一个新工程编译发现如下错误,网上检索居然也没有相关话题。只能自己分析了,看样子应该是rt的库函数,怎么也会出错呢?

C:RT-ThreadStudioworkspacestm32h743iit6Debug/../rt-thread/components/dfs/src/dfs.c:144: undefined reference to rt_realloc' C:RT-ThreadStudioworkspacestm32h743iit6Debug/../rt-thread/components/dfs/src/dfs.c:160: undefined reference to rt_calloc'
./rt-thread/components/dfs/src/dfs.o: In function fd_put': C:RT-ThreadStudioworkspacestm32h743iit6Debug/../rt-thread/components/dfs/src/dfs.c:270: undefined reference to rt_free'
使用源码查处工具发现这几个函数是在memheap.c文件中定义了,得到关键信息heap,

于是回到RT-ThreadStudio界面,找到它的内存配置模块发现是没有启用动态内存管理,如下:

RT-Thread

更改为如下:

RT-Thread

再编译就OK了。

也许这个问题比较简单别人都不屑于记录,但是我觉得分析解决的过程有点意思,于是记录于此分析给大家。

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分