langmanxiaowu 发表于 2013-5-29 15:56:02

用STVD编译STML151C8单片机出现的问题

已经下载了破解版的cosmic,程序和编译出错如下,已经解决了大部分,还有这3个解决不了,求助大神!在线等,望速回复。
#include "stm8l15x.h"
#include "stm8l15x_gpio.h"
void agpio_init()
{
 GPIO_DeInit(GPIOA);
 GPIO_DeInit(GPIOB);
 GPIO_DeInit(GPIOD);
 GPIO_Init(GPIOA,GPIO_Pin_5,GPIO_Mode_Out_PP_Low_Fast);
 GPIO_Init(GPIOB,GPIO_Pin_5,GPIO_Mode_In_FL_No_IT);
 GPIO_Init(GPIOD,GPIO_Pin_5,GPIO_Mode_In_FL_No_IT);
}
 void main()
{
 void agpio_init();
 GPIO_ResetBits(GPIOA,GPIO_Pin_5);
 while (1)
 { 
  if(GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_5)==0)
  {
   GPIO_ToggleBits(GPIOA,GPIO_Pin_5);
  };
  if(GPIO_ReadInputDataBit(GPIOD,GPIO_Pin_5)==0)
  {
   GPIO_ResetBits(GPIOA,GPIO_Pin_5);
  };
  
 }
}报的错误如下
----------- Project gpio_1 - STM8 Cosmic - Configuration Debug -------------
Compiling main.c...
cxstm8 +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8_32K\Hstm8"  -clDebug\ -coDebug\ main.c
#error cpstm8 C:\Program Files\COSMIC\CXSTM8_32K\Hstm8\stm8l15x_itc.h:105(0) missing enumeration member
main.c:
 The command: "cxstm8 +debug -pxp -no -l +mods0 -pp -i"C:\Program Files\COSMIC\CXSTM8_32K\Hstm8"  -clDebug\ -coDebug\ main.c " has failed, the returned value is: 1
exit code=1.
gpio_1.elf - 3 error(s), 0 warning(s)
在贴张图
 

稀饭放姜 发表于 2016-2-1 22:57:47

lucy0827 发表于 2014-7-16 13:40
你好,你的问题解决了吗?我现在也遇到了这个问题,想知道怎么解决,我设定的这个枚举类型在keil里面是可以 ...

今天遇到类似的问题,最后发现是comsic的C编译器规定,枚举类型成员最后一个不要加逗号“,”,否则认为成员丢失。

lucy0827 发表于 2014-7-16 13:40:11

回复:用STVD编译STML151C8单片机出现的问题

你好,你的问题解决了吗?我现在也遇到了这个问题,想知道怎么解决,我设定的这个枚举类型在keil里面是可以编译通过的!

zcl201207 发表于 2016-2-2 22:21:15

:):):):):)
页: [1]
查看完整版本: 用STVD编译STML151C8单片机出现的问题