日期:2014-05-16  浏览次数:20754 次

编译提示,找不到coreleft函数,我包含了alloc.h啊
我在http://www.codepad.org上面提交一段C++代码:
#include <stdio.h>
#include <alloc.h>
int main(void)
{
  printf("Changing allocation with sbrk()\n");
  printf("Before sbrk() call: %lu bytes free\n",
  (unsigned long) coreleft());
  sbrk(1000);
  printf(" After sbrk() call: %lu bytes free\n",
  (unsigned long) coreleft());
  return 0;
}

编译不过,提示:
In function 'int main()':
Line 7: error: 'coreleft' was not declared in this scope
compilation terminated due to -Wfatal-errors.

这是什么原因? coreleft我查手册就在alloc.h里面啊?

------解决方案--------------------
打开alloc.h看看,里面是否有coreleft函数,有没有被什么宏定义开关包含