structure has no member named ,找不到结构成员错误
三个文件:main.c ter_pro.h ter_pro.c
main.c中包含ter_pro.h头
ter_pro.c中包含ter_pro.h头
在ter_pro.h中定义一个结构:
typedef struct ter_pro{
tGuid m_guid; //终端GUID
INT8U m_proType; //主信令
INT8U m_xxx; //定义的结构名
}tTer_Pro;
在main.c中使用如:
int main(int argc, char* argv[])
{
tTer_Pro terPro;
terPro.m_xxx= 0x00;
}
执行编译gcc -lm -g -otest main.c ter_pro.c
提示出错:
main.c:in function main:
structure has no member named 'm_xxx'
明明定义了一个结构,但编译老通不过,这是怎么回事呢。