解决 undefined reference to rpl_malloc 的方案

原文链接: http://www.360doc.com/content/12/0315/16/6938655_194584302.shtml
方案一

打开config.h.in,把如下两句删掉, 重新make即可。
注: 修改config.h.in后,不需要再次configure,因为再次configure可能会重新生成config.h.in,导致下面的这两句又出现在config.h.in里面。

#undef malloc
#undef realloc

方案二

打开configure,发现里面有 #define malloc rpl_malloc 一行。分析 configure 脚本相关的代码,原来是ac_cv_func_malloc_0_nonnull 引起的,OK我们不让它检查了,产生一个cache文件arm- linux.cache,欺骗configure:

[root@linux tslib]# echo "ac_cv_func_malloc_0_nonnull=yes" > arm-linux.cache
[root@linux tslib]# ./configure --prefix=$(pwd)/install --host=arm-linux --cache-file=arm-linux.cache

配置成功后,重新编译一下,OK!

猜你喜欢

转载自blog.csdn.net/hexf9632/article/details/102697237