OpenEdv-开源电子网

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

stm32库函数编译出错

[复制链接]

4

主题

8

帖子

0

精华

新手上路

积分
45
金钱
45
注册时间
2015-4-6
在线时间
0 小时
发表于 2015-4-6 11:51:14 | 显示全部楼层 |阅读模式
5金钱
compiling delay.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: ..\SYSTEM\delay\delay.c: 0 warnings, 1 error
compiling sys.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: ..\SYSTEM\sys\sys.c: 0 warnings, 1 error
compiling usart.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: ..\SYSTEM\usart\usart.c: 0 warnings, 1 error
compiling misc.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: ..\FWLIB\src\misc.c: 0 warnings, 1 error
compiling stm32f10x_gpio.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: ..\FWLIB\src\stm32f10x_gpio.c: 0 warnings, 1 error
compiling stm32f10x_rcc.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: ..\FWLIB\src\stm32f10x_rcc.c: 0 warnings, 1 error
compiling stm32f10x_usart.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: ..\FWLIB\src\stm32f10x_usart.c: 0 warnings, 1 error
compiling main.c...
..\USER\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: main.c: 0 warnings, 1 error
compiling stm32f10x_it.c...
stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
stm32f10x.h:     ^
stm32f10x.h: stm32f10x_it.c: 0 warnings, 1 error
compiling system_stm32f10x.c...
stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
stm32f10x.h:     ^
stm32f10x.h: system_stm32f10x.c: 0 warnings, 1 error
Target not created

之前也有报错,而且是30多个,这个报错是库函数版本不对吗?

最佳答案

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

先在C/C++选项卡设置STM32的类型,比如STM32F10X_HD之类的。
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165371
金钱
165371
注册时间
2010-12-1
在线时间
2110 小时
发表于 2015-4-6 11:51:15 | 显示全部楼层
先在C/C++选项卡设置STM32的类型,比如STM32F10X_HD之类的。
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复

使用道具 举报

3

主题

15

帖子

0

精华

初级会员

Rank: 2

积分
53
金钱
53
注册时间
2015-4-4
在线时间
2 小时
发表于 2015-4-6 12:28:53 | 显示全部楼层
keil5的库函数貌似用的新的
回复

使用道具 举报

4

主题

8

帖子

0

精华

新手上路

积分
45
金钱
45
注册时间
2015-4-6
在线时间
0 小时
 楼主| 发表于 2015-4-6 13:41:19 | 显示全部楼层
回复【2楼】ElfenSterben:
---------------------------------
这是KEIL4
回复

使用道具 举报

3

主题

15

帖子

0

精华

初级会员

Rank: 2

积分
53
金钱
53
注册时间
2015-4-4
在线时间
2 小时
发表于 2015-4-24 20:47:59 | 显示全部楼层
回复【3楼】firsttady:
---------------------------------
是不是设置里面有个条件编译没填
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-2-24 12:19

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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