OpenEdv-开源电子网

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

原子哥用的库函数是不是旧版本的.......

[复制链接]

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
发表于 2014-1-13 18:49:07 | 显示全部楼层 |阅读模式
我用自己建好的工程(使用的是stm32mini),使用的keil 4然后用的是原子的程序进行编程出现错误

用了stm32公用头文件后,问题还是存在,到底怎么回事,求解决
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2014-1-13 19:05:04 | 显示全部楼层
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-13 19:26:22 | 显示全部楼层
回复【2楼】Admin:
---------------------------------
不是,我刚新建了一个工程模板compiling main.c...
..\SYSTEM\sys\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h:   typedef signed long  const sc32;  /* Read Only */
..\SYSTEM\sys\stm32f10x_type.h:                              ^
..\SYSTEM\sys\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h:   typedef volatile signed long  vs32;
..\SYSTEM\sys\stm32f10x_type.h:                                 ^
..\SYSTEM\sys\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h:   typedef volatile signed long  const vsc32;  /* Read Only */
..\SYSTEM\sys\stm32f10x_type.h:                                       ^
..\SYSTEM\sys\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h:   typedef unsigned long  u32;
..\SYSTEM\sys\stm32f10x_type.h:                          ^
..\SYSTEM\sys\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h:   typedef unsigned long  const uc32;  /* Read Only */
..\SYSTEM\sys\stm32f10x_type.h:                                ^
..\SYSTEM\sys\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h:   typedef volatile unsigned long  vu32;
..\SYSTEM\sys\stm32f10x_type.h:                                   ^
..\SYSTEM\sys\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h:   typedef volatile unsigned long  const vuc32;  /* Read Only */
..\SYSTEM\sys\stm32f10x_type.h:                                         ^
..\SYSTEM\sys\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
..\SYSTEM\sys\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
出现这些错误,我是看着视频一步一步来的,还是不行
回复 支持 反对

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2014-1-13 20:21:15 | 显示全部楼层
我们的是V3.5版本,最新版
我是开源电子网?网站管理员,对网站有任何问题,请与我联系!QQ:389063473Email:389063473@qq.com
回复 支持 反对

使用道具 举报

38

主题

2061

帖子

6

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
3273
金钱
3273
注册时间
2012-1-16
在线时间
37 小时
发表于 2014-1-13 21:00:18 | 显示全部楼层
回复【3楼】冬天的阳光:
---------------------------------
声明冲突了,把“stm32f10x_type.h”这个文件去掉
站在巨人的肩膀上不断的前进。。。
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-14 07:39:45 | 显示全部楼层
回复【5楼】xiaoyan:
---------------------------------
删除之后发现好多错误啊...............
回复 支持 反对

使用道具 举报

120

主题

7878

帖子

13

精华

资深版主

Rank: 8Rank: 8

积分
12012
金钱
12012
注册时间
2013-9-10
在线时间
427 小时
发表于 2014-1-14 08:32:02 | 显示全部楼层
回复【6楼】冬天的阳光:
---------------------------------
你用的库函数是那个版本的?
现在,程序把烂铜烂铁变得智能化了,人呢,一旦离开了这烂铜烂铁就不知道干啥了
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-14 11:46:39 | 显示全部楼层
..\SYSTEM\sys\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of "..\USER\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 519 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of "..\USER\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 521 of "..\USER\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 524 of "..\USER\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库函数3,5版本的, keil是3.8..........
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-14 12:01:41 | 显示全部楼层
回复【7楼】Badu_Space:
---------------------------------
..\SYSTEM\sys\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of "..\USER\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 519 of "..\USER\stm32f10x.h")
..\SYSTEM\sys\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of "..\USER\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 521 of "..\USER\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 524 of "..\USER\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库函数3,5版本的, keil是3.8..........
回复 支持 反对

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2014-1-14 12:09:30 | 显示全部楼层
那是你没有加入头文件搭配path吧?
我是开源电子网?网站管理员,对网站有任何问题,请与我联系!QQ:389063473Email:389063473@qq.com
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-14 12:16:39 | 显示全部楼层
回复【10楼】Admin:
---------------------------------
加入什么头文件,我看教程上没有加啊
回复 支持 反对

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2014-1-14 12:36:10 | 显示全部楼层
回复【11楼】 冬天的阳光 :
---------------------------------
头文件路径加入到path。教程中一定是有的。。。。
USER,这些,你都加入到path吗?

我是开源电子网?网站管理员,对网站有任何问题,请与我联系!QQ:389063473Email:389063473@qq.com
回复 支持 反对

使用道具 举报

230

主题

1950

帖子

10

精华

论坛元老

Rank: 8Rank: 8

积分
4562
金钱
4562
注册时间
2010-12-14
在线时间
32 小时
发表于 2014-1-14 12:36:45 | 显示全部楼层
你看的哪个教程
我是开源电子网?网站管理员,对网站有任何问题,请与我联系!QQ:389063473Email:389063473@qq.com
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-14 13:18:26 | 显示全部楼层

我看的是基于库函数3.5建立的keil的详细步骤,总共这7个文件

回复 支持 反对

使用道具 举报

120

主题

7878

帖子

13

精华

资深版主

Rank: 8Rank: 8

积分
12012
金钱
12012
注册时间
2013-9-10
在线时间
427 小时
发表于 2014-1-14 13:31:35 | 显示全部楼层
回复【14楼】冬天的阳光:
---------------------------------
仔细看下“原子教你玩STM32系列视频”的《第4讲 新建基于MDK的STM32工程模板》这个视频教程,张洋大哥都讲的很详细了
现在,程序把烂铜烂铁变得智能化了,人呢,一旦离开了这烂铜烂铁就不知道干啥了
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-14 14:09:11 | 显示全部楼层
回复【15楼】Badu_Space:
---------------------------------
..\SYSTEM\sys\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of "..\USER\stm32f10x.h")我看了,还是这个错误,不知道为什么
回复 支持 反对

使用道具 举报

120

主题

7878

帖子

13

精华

资深版主

Rank: 8Rank: 8

积分
12012
金钱
12012
注册时间
2013-9-10
在线时间
427 小时
发表于 2014-1-14 14:16:16 | 显示全部楼层
回复【16楼】冬天的阳光:
---------------------------------
库函数没“stm32f10x_type.h“这个头文件吧。。。

s32定义是在”stm32f10x.h“这个头文件内,我的
现在,程序把烂铜烂铁变得智能化了,人呢,一旦离开了这烂铜烂铁就不知道干啥了
回复 支持 反对

使用道具 举报

6

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
75
金钱
75
注册时间
2014-1-13
在线时间
2 小时
 楼主| 发表于 2014-1-14 14:31:28 | 显示全部楼层
回复【17楼】Badu_Space:
---------------------------------
恩恩呢 库函数里面没有stm32f10x_type.h这个头文件,那应该怎么解决啊
回复 支持 反对

使用道具 举报

120

主题

7878

帖子

13

精华

资深版主

Rank: 8Rank: 8

积分
12012
金钱
12012
注册时间
2013-9-10
在线时间
427 小时
发表于 2014-1-14 15:49:01 | 显示全部楼层
回复【18楼】冬天的阳光:
---------------------------------
不加这个头文件即可
现在,程序把烂铜烂铁变得智能化了,人呢,一旦离开了这烂铜烂铁就不知道干啥了
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-7-6 16:59

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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