CCS4下C语言使用malloc.h内的函数编译不通过,

[复制链接]
5768|5
 楼主| jinpaidianzi 发表于 2012-8-24 20:15 | 显示全部楼层 |阅读模式
在CCS下C语言使用malloc.h内的函数编译不通过,

代码:#include <malloc.h>

1. could not open source file "malloc.h"

2. 若注销掉此行,则其内所有内存操作函数如malloc();等都不能使用了;
 楼主| jinpaidianzi 发表于 2012-8-24 20:15 | 显示全部楼层
请问下这是什么原因,怎么解决?我使用的是CCS4
acer4736 发表于 2012-8-24 20:28 | 显示全部楼层
在CCSv4下,你需要将malloc.h的位置指定正确,请参考如下
\Texas Instruments\ccsv4\simulation\bin\components\photon\gcc\include\malloc.h
gexingyouxian 发表于 2012-8-24 22:16 | 显示全部楼层
需要设定--heap_size和使用
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
yangguangaisha 发表于 2012-8-24 22:30 | 显示全部楼层
我也碰到了同样的问题,我的是ccs3.3,不知道是怎么回事
G21372 发表于 2012-8-24 22:36 | 显示全部楼层
使用了malloc函数,应该还要用free函数吧,这个free函数的头文件也应该包含吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

115

主题

1489

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部