error: declaration may not appear after executable statement in block
来源:互联网 发布:ubuntu安装虚拟机 编辑:程序博客网 时间:2024/05/16 05:08
这个问题是在编译STM32的程序时遇到的,这个错误的原因是对于变量的声明不能放在可执行语句后面,必须在主函数开头声明变量。在程序中声明一个变量时,需要在可执行语句之前声明,否则会出现以上错误。
在keil中编写stm32代码报错如标题
错误代码部分如下
void EXTIX_Init(void)
{
Edge_Io_Init();
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);//使能复用功能时钟
修改为如下即可
void EXTIX_Init(void)
{
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
Edge_Io_Init();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);//使能复用功能时钟
在keil中编写stm32代码报错如标题
错误代码部分如下
void EXTIX_Init(void)
{
Edge_Io_Init();
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);//使能复用功能时钟
修改为如下即可
void EXTIX_Init(void)
{
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
Edge_Io_Init();
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);//使能复用功能时钟
0 0
- error: declaration may not appear after executable statement in block
- error: declaration may not appear after executable statement in block
- error: declaration may not appear after executable statement in block
- error: declaration may not appear after executable statement in block
- declaration may not appear after executable statement in block
- KeilMDK 编译报错:error: #268: declaration may not appear after executable statement in block
- stm32:error: #268: declaration may not appear after executable statement in block
- 【complier】error: #268: declaration may not appear after executable statement in block
- 搞定error: #268: declaration may not appear after executable statement
- keil中变量声明问题及error: #268: declaration may not appear after executable statement in block
- #268: declaration may not appear after executable statement in block 另类错误原因
- error: #268: declaration may not appear after executabl statement in block
- 使用Keil-STM32,cmsis_os.c 出现 error: #268: declaration may not appear after executable....
- SQL Error:An aggregate may not appear in the set list of an UPDATE statement.
- 【XML码农】【Error】The XML declaration may only appear at the very beginning of the document.
- error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
- [Error]Namespace declaration statement has to be the very first statement in the script
- not in executable format
- 一次完整的HTTP事务是怎样一个过程?
- 1.OC第一个工程,类的设计,重构方法,构造函数
- hdu 5427 A problem of sorting
- Android列表ListView控件的使用
- HDU 3652 B-number (数位dp)
- error: declaration may not appear after executable statement in block
- arm的2级页表在Linux内核创建过程解析
- c语言学习之顺序结构
- python 学习笔记(=)
- Servlet+JSP+JavaBean开发模式(MVC)介绍
- (转) 安卓实现parcelable接口作用
- 数据库技术之rank、dense_rank、ntile、row_number函数的区别
- 在Openwrt 上使用迅雷远程下载功能
- web中的URL