当前位置: 技术问答>linux和unix
编译提示,找不到coreleft函数,我包含了alloc.h啊
来源: 互联网 发布时间:2017-02-27
本文导语: 我在http://www.codepad.org上面提交一段C++代码: #include #include int main(void) { printf("Changing allocation with sbrk()n"); printf("Before sbrk() call: %lu bytes freen", (unsigned long) coreleft()); sbrk(1000); printf(...
我在http://www.codepad.org上面提交一段C++代码:
#include
#include
int main(void)
{
printf("Changing allocation with sbrk()n");
printf("Before sbrk() call: %lu bytes freen",
(unsigned long) coreleft());
sbrk(1000);
printf(" After sbrk() call: %lu bytes freen",
(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里面啊?
#include
#include
int main(void)
{
printf("Changing allocation with sbrk()n");
printf("Before sbrk() call: %lu bytes freen",
(unsigned long) coreleft());
sbrk(1000);
printf(" After sbrk() call: %lu bytes freen",
(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函数,有没有被什么宏定义开关包含