修改编译参数
OSX 10.5+以——10.11,MAC把malloc.h放在 /usr/include/malloc中
编译的时候
makefile中添加编译选项
CFLAGS=-I/usr/include/malloc
编译前修改系统变量
export CFLAGS=-I/usr/include/malloc
用sys/malloc.h替换malloc.h
1 |
|
放弃malloc.h,使用标准stdlib.h
1 |
stdlib.h is a standard C header that declares among other things the malloc(), calloc(), free() functions. This is the header you should include. |
近期评论