Quantcast
Channel: C2000™︎ 微控制器论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 12286

使用F28M35添加自己写的头文件时,出现了“XXX”has already been declared in the current scope的问题

$
0
0

struct TODAY_BIT {
Uint16 MORNING:16;
Uint16 AFTERNOON:16;
};


union TODAY_REG{
Uint32 all;
struct TODAY_BIT bit;
};

我在头文件里写了上述两组结构,然后出现了如下的报错:

Description Resource Path Location Type
"TODAY_BIT" has already been declared in the current scope ECAN_T&R.h /BasedOnCan_M3_2_Eyior line 44 C/C++ Problem

Description Resource Path Location Type
"TODAY_BIT" has already been declared in the current scope ECAN_T&R.h /BasedOnCan_M3_2_Eyior line 44 C/C++ Problem

***************************************************************************************************************************************************

分割线

***************************************************************************************************************************************************

因为头文件里面的内容是自己写的,所以不存在重复定义的问题。至于为什么提示重复声明,我真的不知道。

求大神解答,这个问题困惑我很久了。

附头文件全部代码:

//###########################################################################
//
// FILE: Pepsi_wall.h
//
//###########################################################################

#define ECAN_R&T;

#ifdef __cplusplus
extern "C" {
#endif


/*******************************************
* define a struct type for resister T and R
*******************************************/
struct WALL_BIT{
Uint16 rock0:16;
Uint16 rock1:16;
};
union WALL_REG{
Uint32 all;
struct WALL_BIT bit;
};

struct CLASSROOM_BIT{
union WALL_REG wall0;
union WALL_REG wall1;
};


/*********************************************/

/*******************************************
* define a struct type for resister T and R
*******************************************/

struct TODAY_BIT {
Uint16 MORNING:16;
Uint16 AFTERNOON:16;
};
union TODAY_REG{
Uint32 all;
struct TODAY_BIT bit;
};

/**********************************************/


/*******************************************
* define a struct type for order
*******************************************/

struct ORDER_BIT{
Uint16 order0:1;
Uint16 order1:1;
Uint16 order2:1;
Uint16 order3:1;
Uint16 order4:1;
Uint16 order5:1;
Uint16 order6:1;
Uint16 order7:1;
Uint16 order8:1;
Uint16 order9:1;
Uint16 order10:1;
Uint16 order11:1;
Uint16 order12:1;
Uint16 order13:1;
Uint16 order14:1;
Uint16 order15:1;
Uint16 order16:1;
Uint16 order17:1;
Uint16 order18:1;
Uint16 order19:1;
Uint16 order20:1;
Uint16 order21:1;
Uint16 order22:1;
Uint16 order23:1;
Uint16 order24:1;
Uint16 order25:1;
Uint16 order26:1;
Uint16 order27:1;
Uint16 order28:1;
Uint16 order29:1;
Uint16 order30:1;
Uint16 order31:1;
};

union ORDER_REG{
Uint32 all;
struct ORDER_BIT bit;
};


/*****************************************************************************************************************************/

完毕  求大神解答,这个问题困惑我很久了。


Viewing all articles
Browse latest Browse all 12286

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>