OpenEdv-开源电子网

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

#include #include 与#include "stm32f10x.h"有什么区别呢?

[复制链接]

1

主题

9

帖子

0

精华

新手上路

积分
33
金钱
33
注册时间
2014-3-24
在线时间
0 小时
发表于 2014-9-22 14:48:35 | 显示全部楼层 |阅读模式
5金钱
在单独的矩阵键盘中led和delay中调用了"stm32f10x.h",程序正常运行;在MINI板中led和delay中用了<stm32f10x_map.h>、<stm32f10x_nvic.h>,在加入键盘程序后,程序报错,
[mw_shl_code=c,true]compiling key2.c... ..\SYSTEM\sys\stm32f10x_type.h(23): error: #256: invalid redeclaration of type name "s32" (declared at line 312 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(27): error: #256: invalid redeclaration of type name "sc32" (declared at line 316 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(31): error: #256: invalid redeclaration of type name "vs32" (declared at line 320 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(35): error: #256: invalid redeclaration of type name "vsc32" (declared at line 324 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(39): error: #256: invalid redeclaration of type name "u32" (declared at line 328 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(43): error: #256: invalid redeclaration of type name "uc32" (declared at line 332 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(47): error: #256: invalid redeclaration of type name "vu32" (declared at line 336 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(51): error: #256: invalid redeclaration of type name "vuc32" (declared at line 340 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(55): error: #101: "FALSE" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(55): error: #101: "TRUE" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(55): error: #256: invalid redeclaration of type name "bool" (declared at line 345 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(57): error: #101: "RESET" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(57): error: #101: "SET" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(57): error: #256: invalid redeclaration of type name "FlagStatus" (declared at line 348 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(57): error: #256: invalid redeclaration of type name "ITStatus" (declared at line 348 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(59): error: #101: "DISABLE" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(59): error: #101: "ENABLE" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(59): error: #256: invalid redeclaration of type name "FunctionalState" (declared at line 350 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_type.h(62): error: #101: "ERROR" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(62): error: #101: "SUCCESS" has already been declared in the current scope ..\SYSTEM\sys\stm32f10x_type.h(62): error: #256: invalid redeclaration of type name "ErrorStatus" (declared at line 353 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_conf.h(147): warning: #47-D: incompatible redefinition of macro "HSE_Value" (declared at line 83 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\cortexm3_macro.h(30): error: #55: too many arguments in macro invocation ..\SYSTEM\sys\cortexm3_macro.h(30): error: #79: expected a type specifier ..\SYSTEM\sys\cortexm3_macro.h(31): error: #55: too many arguments in macro invocation ..\SYSTEM\sys\cortexm3_macro.h(31): error: #79: expected a type specifier ..\SYSTEM\sys\cortexm3_macro.h(32): error: #55: too many arguments in macro invocation ..\SYSTEM\sys\cortexm3_macro.h(32): error: #79: expected a type specifier ..\SYSTEM\sys\stm32f10x_map.h(58): error: #256: invalid redeclaration of type name "ADC_TypeDef" (declared at line 389 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_map.h(154): error: #256: invalid redeclaration of type name "BKP_TypeDef" (declared at line 488 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") ..\SYSTEM\sys\stm32f10x_map.h(163): error: #256: invalid redeclaration of type name "CAN_TxMailBox_TypeDef" (declared at line 500 of "d:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h") Target not created[/mw_shl_code]
找不到解决方法,原子哥救命!!

最佳答案

查看完整内容[请看2#楼]

invalid redeclaration 重复声明了,stm32f10x_map.h和stm32f10x.h有重复定义的部分,包含其中一个就行了
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

8

主题

125

帖子

0

精华

高级会员

Rank: 4

积分
844
金钱
844
注册时间
2013-4-27
在线时间
120 小时
发表于 2014-9-22 14:48:36 | 显示全部楼层
invalid redeclaration
重复声明了,stm32f10x_map.h和stm32f10x.h有重复定义的部分,包含其中一个就行了
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

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

使用道具 举报

3

主题

2178

帖子

2

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
3323
金钱
3323
注册时间
2013-7-19
在线时间
195 小时
发表于 2014-9-22 19:28:54 | 显示全部楼层
stm32f10x_map.h不需要,你看看是不是stm32f10x.h里面已经包含了 stm32f10x_map.h
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-7-1 01:50

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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