由于MDK5.0A没有STM32F103程序错误 stm32f10x.h(298): error: #67: expected a "}"
来源:互联网 发布:linux shell编程pdf 编辑:程序博客网 时间:2024/06/05 03:58
由于MDK4.72A没有STM32F030,所以升级到了MDK5.0
我的程序在MDK4.72A下编译正常没有任何错误,升级软件后程序都出现了同样的问题,请大家帮我看看,这个是什么原因。
Build target '103RE_安卓_Print1'
compiling main.c...
.\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
.\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
Source\User\main.c: 1 warning, 1 error
解决方法如下:
方法1、在C/C++选项卡里,把STM3210X_HD从prepocessor symbol define 里面删掉`(*∩_∩*)′
这么做的原因:在老版本的官方STM32F10X.H文件里,这句话不是这么写的,若没记错的话,是
...&&!defined(STM32F10X_HD) && ...
原来是有括号的,不做标识符来处理,而新版的,如图,直接说明了出来,那就没有必要,可以根据C/C++知识自己去推断;
具体可以看搜“[STM32系列贴-初级]之STM32F10X工程建立详细过程及问题解决”
方法2、原先的Keil::STM32F1xx_DFP安装包是你直接从uVision4升级到uVision5后保留的,使用PackInstaller将原先的包1.0.2 Remove + Delete Pack,然后重新下载安装Keil::STM32F1xx_DFP,版本应该是1.0.0,问题解决,库不兼容
方法2没试,不知是否可行!!
选择芯片后就不需要在option->c/c++中再定义类似STM32F103_HD的东西了
因为选择芯片时已经加进去了。而且当你的定义和你选择的芯片不同时,会报错:
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
阅读全文
0 0
- 由于MDK5.0A没有STM32F103程序错误 stm32f10x.h(298): error: #67: expected a "}"
- 提示..\CMSIS\stm32f10x.h(383): error: #67: expected a "}"错误
- stm32f10x.h(244): error: #67: expected a "}"
- \lib\cmsis\stm32f10x.h(298): error: #67: expected a "}"
- keil4升级到keil5出现..\USER\stm32f10x.h(298): error: #67: expected a "}"错误
- Keil------解决..\SYSTEM\sys\stm32f10x.h(298): error: #67: expected a "}"
- ..\USER\stm32f10x.h(428): error: #67: expected a "}" ADC1_2_IRQn = 18, /*!<
- Error[Pe127]: expected a statement 错误
- MDK升级引起的类似.\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error: #67: exp
- error: At end of source: #67: expected a "}"
- error: expected a property attribute before 'strong'
- CCS 关于 error: expected a ")" 问题
- error: expected a property attribute before 'strong'
- 菜鸟点滴--error: #130: expected a "{
- 菜鸟点滴--error: #130: expected a "{"
- keil C编译error : expected a ")"
- TMS320C6748DSP开发出现 error: expected a ")" 问题
- C++builder出现错误:[Linker Fatal Error] Fatal: Expected a file name:
- 关于kali64位下安装ferret
- 2017浙工大之江学院校赛 M dp||记忆化搜索
- haproxy
- EF读取数据库
- js 制作年历
- 由于MDK5.0A没有STM32F103程序错误 stm32f10x.h(298): error: #67: expected a "}"
- Android入门
- 计蒜客初赛3练习赛
- 187.m1-ActionBar和ViewPager交互的改进
- Instantiating a container
- MyFlag Step10:后台代码解耦与客户端具体功能设计
- 阶乘之和-南阳OJ-71题
- 虚伪的自己
- c++ 串