编译中'::malloc' has not been declared问题

s253425456 2012-11-02 04:36:53
我用autotools 制作makefile 生成so

交叉编译
编译时报错'::malloc' has not been declared


用命令行编译可以通过,不知什么原因?
...全文
836 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mymtom 2012-11-06
  • 打赏
  • 举报
回复
#include <cstdlib>
s253425456 2012-11-06
  • 打赏
  • 举报
回复
引用 2 楼 mymtom 的回复:
#include <cstdlib>
没做用,应该不是头文件的问题,命令行可以编译通过
s253425456 2012-11-02
  • 打赏
  • 举报
回复
makefile编译如下:
arm-none-linux-gnueabi-g++ -DPACKAGE_NAME=\"FULL-PACKAGE-NAME\" -DPACKAGE_TARNAME=\"full-package-name\" -DPACKAGE_VERSION=\"VERSION\" -DPACKAGE_STRING=\"FULL-PACKAGE-NAME\ VERSION\" -DPACKAGE_BUGREPORT=\"BUG-REPORT-ADDRESS\" -DPACKAGE=\"full-package-name\" -DVERSION=\"VERSION\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_LOCALE_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_WCHAR_H=1 -DHAVE_STDBOOL_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=0 -Dmalloc=rpl_malloc -DHAVE_BZERO=1 -DHAVE_MEMSET=1 -DHAVE_PATHCONF=1 -DHAVE_POW=1 -DHAVE_SELECT=1 -DHAVE_SETLOCALE=1 -DHAVE_SQRT=1 -I. -L../lib -shared -fpic -lpthread -ldl -lrt -lTmc_RDS -g -O2 -MT libtmc_so-JamReportMnger.o -MD -MP -MF .deps/libtmc_so-JamReportMnger.Tpo -c -o libtmc_so-JamReportMnger.o `test -f 'JamReportMnger.cpp' || echo './'`JamReportMnger.cpp
In file included from /usr/local/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/bits/stl_algo.h:60,
from /usr/local/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/algorithm:62,
from JamReportMnger.h:6,
from JamReportMnger.cpp:1:
/usr/local/arm/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/cstdlib:119: error: '::malloc' has not been declared


命令行如下:
arm-none-linux-gnueabi-g++ -L../lib -shared -fpic -lpthread -ldl -lrt -lTmc_RDS *.cpp -g -O2 -o libout.so

23,215

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧