ucos2移植stm32遇到的问题??
如题:按网上的方法移植后,编译,出现如下问题,出现问题的提示是uCOS_II.H头文件(可是这个文件我就没改过,所以应该问题不是在里面)我考一部分编译器keil的提示如下...
如题:按网上的方法移植后,编译,出现如下问题,
出现问题的提示是uCOS_II.H头文件(可是这个文件我就没改过,所以应该问题不是在里面)
我考一部分编译器keil的提示如下,望高人解决!非常感谢。
.\uCOS-II\Source\ucos_ii.h(346): error: #130: expected a "{"
.\uCOS-II\Source\ucos_ii.h: typedef INT8U OS_PRIO;
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(352): warning: #12-D: parsing restarts here after previous syntax error
.\uCOS-II\Source\ucos_ii.h: typedef struct os_event {
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(356): error: #20: identifier "OS_PRIO" is undefined
.\uCOS-II\Source\ucos_ii.h: OS_PRIO OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(357): error: #20: identifier "OS_PRIO" is undefined
.\uCOS-II\Source\ucos_ii.h: OS_PRIO OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(353): warning: #177-D: variable "OSEventType" was declared but never referenced
.\uCOS-II\Source\ucos_ii.h: INT8U OSEventType; /* Type of event control block (see OS_EVENT_TYPE_xxxx) */
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(354): warning: #177-D: variable "OSEventPtr" was declared but never referenced
.\uCOS-II\Source\ucos_ii.h: void *OSEventPtr; /* Pointer to message or queue structure */ 展开
出现问题的提示是uCOS_II.H头文件(可是这个文件我就没改过,所以应该问题不是在里面)
我考一部分编译器keil的提示如下,望高人解决!非常感谢。
.\uCOS-II\Source\ucos_ii.h(346): error: #130: expected a "{"
.\uCOS-II\Source\ucos_ii.h: typedef INT8U OS_PRIO;
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(352): warning: #12-D: parsing restarts here after previous syntax error
.\uCOS-II\Source\ucos_ii.h: typedef struct os_event {
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(356): error: #20: identifier "OS_PRIO" is undefined
.\uCOS-II\Source\ucos_ii.h: OS_PRIO OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(357): error: #20: identifier "OS_PRIO" is undefined
.\uCOS-II\Source\ucos_ii.h: OS_PRIO OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(353): warning: #177-D: variable "OSEventType" was declared but never referenced
.\uCOS-II\Source\ucos_ii.h: INT8U OSEventType; /* Type of event control block (see OS_EVENT_TYPE_xxxx) */
.\uCOS-II\Source\ucos_ii.h: ^
.\uCOS-II\Source\ucos_ii.h(354): warning: #177-D: variable "OSEventPtr" was declared but never referenced
.\uCOS-II\Source\ucos_ii.h: void *OSEventPtr; /* Pointer to message or queue structure */ 展开
1个回答
展开全部
我移植的时候也碰到一些问题(STM32的固件库版本不同),但ucos_ii.h这个文件没问题。你可以从第一个错误开始查找错误原因。像你上面贴出的第一个错误应该是缺“{”的简单语法错误,而后面的错误基本上是这个错误导致的。你也可以把ucos_ii.h贴出来看看,虽然你没改过,但不能保证别人上传之前修改过吧。
追问
谢谢!问题找到了,原来是ucos_ii.h中包含另一个头文件,而这个头文件少写了一个;号,所以导致了ucos_ii.h中编译出错。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询