你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

查看: 5439|回复: 3

missing prototype stm8 in stvd with cosmic

[复制链接]

2

主题

2

回帖

0

蝴蝶豆

新手上路

最后登录
2018-10-29
发表于 2013-8-28 20:19:58 | 显示全部楼层 |阅读模式
谁能告诉这个main.c编译出错是应为什么原因?????如果删除func()则编译通过
环境:win7  stm8s103f3   stvd   cosmic
 
 
//main.c
int var;
void func(){
        var ++;
}
main(){
        var = 0;
        func();   //#error cpstm8 ..\..\source\main.c:14(2) missing prototype
        while (1)func();  //#error cpstm8 ..\..\source\main.c:14(2) missing prototype
}
----------- Project ikea25wdim - STM8 Cosmic - Configuration Debug -------------


Compiling ..\..\source\main.c...
cxstm8 +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8_32K\Hstm8"  -clDebug\ -coDebug\ ..\..\source\main.c 
#error cpstm8 ..\..\source\main.c:14(2) missing prototype
#error cpstm8 ..\..\source\main.c:15(11) missing prototype
..\..\source\main.c:
 The command: "cxstm8 +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8_32K\Hstm8"  -clDebug\ -coDebug\ ..\..\source\main.c " has failed, the returned value is: 1
exit code=1.
 
 
回复

使用道具 举报

13

主题

63

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2013-9-7 12:39:17 | 显示全部楼层

RE: missing prototype stm8 in stvd with cosmic

这些函数的功能没有定义,你定义这些函数。或者可能你没有添加c文件吧。
回复 支持 反对

使用道具 举报

3

主题

161

回帖

0

蝴蝶豆

新手上路

最后登录
1970-1-1
发表于 2013-9-7 12:47:28 | 显示全部楼层

RE: missing prototype stm8 in stvd with cosmic

你用的函数没有定义。
解决办法:把这些函数在main前定义就不会出现这个了。
还有一个笨办法:
你把被调用的函数写在前面.
也就是你把主函数写在程序的最后面,就不会出现这些
回复 支持 反对

使用道具 举报

2

主题

2

回帖

0

蝴蝶豆

新手上路

最后登录
2018-10-29
 楼主| 发表于 2013-10-10 12:10:56 | 显示全部楼层

RE: missing prototype stm8 in stvd with cosmic

func函数明明就定义在main函数前面的啊!就做了个++运算而已。
回复 支持 反对

使用道具 举报

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版