OpenEdv-开源电子网

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

原子哥的例程,用Keil uVision4.54编译出错,这是为什么?

[复制链接]

6

主题

46

帖子

0

精华

初级会员

Rank: 2

积分
134
金钱
134
注册时间
2012-8-7
在线时间
11 小时
发表于 2012-8-11 15:22:18 | 显示全部楼层 |阅读模式
Rebuild target 'Target 1'
assembling STM32F10x.s...
compiling test.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling delay.c...
..\SYSTEM\delay\delay.c(1): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling sys.c...
..\SYSTEM\sys\sys.c(1): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling usart.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling led.c...
..\HARDWARE\LED\led.c(1): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling key.c...
..\HARDWARE\KEY\key.c(1): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling wdg.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling timer.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling ILI93xx.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling rtc.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling wkup.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling adc.c...
..\HARDWARE\ADC\adc.c(1): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling dma.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling 24cxx.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling myiic.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling spi.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling flash.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling 24l01.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling MMC_SD.C...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling remote.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling ds18b20.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling mouse.c...
..\SYSTEM\delay\delay.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling ps2.c...
..\SYSTEM\delay\delay.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling VS10XX.c...
..\HARDWARE\VS10XX\VS10XX.c(1): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling FAT.C...
..\FAT\FAT.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling fontupd.c...
..\TEXT\fontupd.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling text.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling untogb.c...
..\TEXT\untogb.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling mp3player.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling usmart.c...
..\SYSTEM\usart\usart.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling usmart_config.c...
..\SYSTEM\sys\sys.h(3): error:  #5: cannot open source input file "stm32f10x_lib.h": No such file or directory
compiling usmart_str.c...
Target not created
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

3

主题

14

帖子

0

精华

初级会员

Rank: 2

积分
71
金钱
71
注册时间
2012-8-1
在线时间
10 小时
发表于 2012-8-11 15:35:24 | 显示全部楼层
你这个是新装的吧?
4.54?
有这个版本了?
看看你的安装文件,里面应该没有stm32f10x_lib.h这个文件
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165524
金钱
165524
注册时间
2010-12-1
在线时间
2116 小时
发表于 2012-8-11 17:38:36 | 显示全部楼层
缺文件.
回复 支持 反对

使用道具 举报

头像被屏蔽

263

主题

455

帖子

1

精华

禁止访问

积分
1212
金钱
1212
注册时间
2011-9-25
在线时间
12 小时
发表于 2012-8-11 19:30:01 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

2

主题

3

帖子

0

精华

新手上路

积分
37
金钱
37
注册时间
2012-8-13
在线时间
3 小时
发表于 2012-8-13 15:38:30 | 显示全部楼层
回复【4楼】syhx8262516:
---------------------------------
stm32f10x_lib.h这个文件变成stm32f10x.h了,那程序应该怎么改呢?

回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165524
金钱
165524
注册时间
2010-12-1
在线时间
2116 小时
发表于 2012-8-13 20:18:06 | 显示全部楼层
回复【5楼】yumennannai:
---------------------------------
把前者改为后者.
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

6

主题

68

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
464
金钱
464
注册时间
2013-12-2
在线时间
58 小时
发表于 2013-12-16 16:08:25 | 显示全部楼层
改完后又出现新的问题:C:\Keil\ARM\Inc\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"该怎么解决呀?
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165524
金钱
165524
注册时间
2010-12-1
在线时间
2116 小时
发表于 2013-12-16 23:32:26 | 显示全部楼层
回复【7楼】849928055:
---------------------------------
先在配置选项卡的C/C++选项卡里面,设置你的STM32型号!
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

6

主题

68

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
464
金钱
464
注册时间
2013-12-2
在线时间
58 小时
发表于 2013-12-17 10:10:49 | 显示全部楼层
回复【8楼】正点原子:
---------------------------------
谢谢原子哥
回复 支持 反对

使用道具 举报

0

主题

1

帖子

0

精华

新手入门

积分
21
金钱
21
注册时间
2014-4-10
在线时间
0 小时
发表于 2014-4-13 14:46:46 | 显示全部楼层
回复【8楼】正点原子:
---------------------------------
原子哥,我也出现了这种情况,但打开C/C++选项卡没发现有配置stm32型号的选项啊
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165524
金钱
165524
注册时间
2010-12-1
在线时间
2116 小时
发表于 2014-4-13 21:11:10 | 显示全部楼层
定义一个:STM32F10X_MD的宏就可以了
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

8

主题

43

帖子

0

精华

初级会员

Rank: 2

积分
133
金钱
133
注册时间
2014-5-5
在线时间
17 小时
发表于 2014-5-5 19:50:40 | 显示全部楼层
回复【11楼】正点原子:
---------------------------------
原子哥,怎么定义,麻烦给个方案!新手
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165524
金钱
165524
注册时间
2010-12-1
在线时间
2116 小时
发表于 2014-5-6 00:21:08 | 显示全部楼层
回复【12楼】chengqing:
---------------------------------
在C/C++选项卡里面设置。
具体请看我们战舰板的代码/教程。
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

0

主题

4

帖子

0

精华

新手入门

积分
24
金钱
24
注册时间
2014-8-17
在线时间
0 小时
发表于 2014-8-22 00:46:37 | 显示全部楼层
...\Keil\ARM\Pack\Keil\STM32F1xx_DFP\1.0.5\Flash\STM32F10x

mdk5是在这个文件夹里面的吧
回复 支持 反对

使用道具 举报

0

主题

4

帖子

0

精华

新手入门

积分
24
金钱
24
注册时间
2014-8-17
在线时间
0 小时
发表于 2014-8-22 01:53:41 | 显示全部楼层
解决方法,应该是将头文件处,stm32f10x_lib.h换为stm32f10x.h,同时在工程文件夹下里包含stm32f10x.h,并在在C/C++选项卡里面设置include path,并且把所在文件夹包含在工程项目下面
回复 支持 反对

使用道具 举报

14

主题

58

帖子

0

精华

初级会员

Rank: 2

积分
163
金钱
163
注册时间
2015-8-5
在线时间
9 小时
发表于 2015-9-23 14:18:56 | 显示全部楼层
可以把缺失的stm32f10x.h放到工程文件目录的sys文件夹下,然后把之前的库头文件换为stm32f10x.h
回复 支持 反对

使用道具 举报

0

主题

56

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
254
金钱
254
注册时间
2015-10-15
在线时间
39 小时
发表于 2016-9-13 11:32:54 | 显示全部楼层
新手刚开始学,原来define是定义宏的多谢了
回复 支持 反对

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-5-25 16:17

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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