OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 7299|回复: 1

报错求助

[复制链接]

2

主题

3

帖子

0

精华

新手入门

积分
31
金钱
31
注册时间
2012-10-24
在线时间
0 小时
发表于 2012-11-23 20:51:13 | 显示全部楼层 |阅读模式
我用的MDK4.12 打开板子自带的源程序,编译没问题。我自己新建了一个新的程序,根源程序除了工程名不一样,其他都一样,各种报错啊,求帮助。。。


D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(312): error:  #256: invalid redeclaration of type name "s32" (declared at line 23 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef int32_t  s32; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                    ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(316): error:  #256: invalid redeclaration of type name "sc32" (declared at line 27 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef const int32_t sc32;  /*!< Read Only */ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                         ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(320): error:  #256: invalid redeclaration of type name "vs32" (declared at line 31 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef __IO int32_t  vs32; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                         ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(324): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 35 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef __I int32_t vsc32;  /*!< Read Only */ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                       ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(328): error:  #256: invalid redeclaration of type name "u32" (declared at line 39 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef uint32_t  u32; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(332): error:  #256: invalid redeclaration of type name "uc32" (declared at line 43 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef const uint32_t uc32;  /*!< Read Only */ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                          ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(336): error:  #256: invalid redeclaration of type name "vu32" (declared at line 47 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef __IO uint32_t  vu32; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                          ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(340): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 51 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef __I uint32_t vuc32;  /*!< Read Only */ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                        ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(345): error:  #101: "FALSE" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {FALSE = 0, TRUE = !FALSE} bool; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                 ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(345): error:  #101: "TRUE" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {FALSE = 0, TRUE = !FALSE} bool; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                            ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(345): error:  #256: invalid redeclaration of type name "bool" (declared at line 55 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {FALSE = 0, TRUE = !FALSE} bool; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                                           ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error:  #101: "RESET" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                 ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error:  #101: "SET" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                            ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 57 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                                          ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(348): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 57 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                                                      ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(350): error:  #101: "DISABLE" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                 ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(350): error:  #101: "ENABLE" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                              ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(350): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 59 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                                                 ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(353): error:  #101: "ERROR" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                 ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(353): error:  #101: "SUCCESS" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                            ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(353): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 62 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:                                              ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(389): error:  #256: invalid redeclaration of type name "ADC_TypeDef" (declared at line 58 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } ADC_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(488): error:  #256: invalid redeclaration of type name "BKP_TypeDef" (declared at line 154 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } BKP_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(500): error:  #256: invalid redeclaration of type name "CAN_TxMailBox_TypeDef" (declared at line 163 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } CAN_TxMailBox_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(512): error:  #256: invalid redeclaration of type name "CAN_FIFOMailBox_TypeDef" (declared at line 171 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } CAN_FIFOMailBox_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(522): error:  #256: invalid redeclaration of type name "CAN_FilterRegister_TypeDef" (declared at line 177 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } CAN_FilterRegister_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(556): error:  #256: invalid redeclaration of type name "CAN_TypeDef" (declared at line 203 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } CAN_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(569): error:  #256: invalid redeclaration of type name "CRC_TypeDef" (declared at line 213 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } CRC_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(590): error:  #256: invalid redeclaration of type name "DAC_TypeDef" (declared at line 232 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   } DAC_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:     ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(600): error:  #256: invalid redeclaration of type name "DBGMCU_TypeDef" (declared at line 239 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:   }DBGMCU_TypeDef; D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h:    ^ D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h: test.c: 0 warnings, 30 errors


正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2012-11-23 21:09:40 | 显示全部楼层
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-7-18 21:40

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表