keil环境下,报错#70:incomplete type is not allowed,报错在struct psock
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/09/22 19:32:11
keil环境下,报错#70:incomplete type is not allowed,报错在struct psock sin,sout;
struct psock{
struct pt pt, psockpt; /* Protothreads - one that's using the psock
functions, and one that runs inside the
psock functions. */
const u8_t *sendptr; /* Pointer to the next data to be sent. */
u8_t *readptr; /* Pointer to the next data to be read. */
char *bufptr; /* Pointer to the buffer used for buffering
incoming data. */
u16_t sendlen; /* The number of bytes left to be sent. */
u16_t readlen; /* The number of bytes left to be read. */
struct psock_buf buf; /* The structure holding the state of the
input buffer. */
unsigned int bufsize; /* The size of the input buffer. */
unsigned char state; /* The state of the protosocket. */
};
已经定义了psock啊,怎么老是提示有错啊,难道要typedef,但是pt也是个结构体却没有typedef啊,我就觉得奇怪了,被这个问题困扰很久了
struct psock{
struct pt pt, psockpt; /* Protothreads - one that's using the psock
functions, and one that runs inside the
psock functions. */
const u8_t *sendptr; /* Pointer to the next data to be sent. */
u8_t *readptr; /* Pointer to the next data to be read. */
char *bufptr; /* Pointer to the buffer used for buffering
incoming data. */
u16_t sendlen; /* The number of bytes left to be sent. */
u16_t readlen; /* The number of bytes left to be read. */
struct psock_buf buf; /* The structure holding the state of the
input buffer. */
unsigned int bufsize; /* The size of the input buffer. */
unsigned char state; /* The state of the protosocket. */
};
已经定义了psock啊,怎么老是提示有错啊,难道要typedef,但是pt也是个结构体却没有typedef啊,我就觉得奇怪了,被这个问题困扰很久了
struct psock{
.
}Psock;
struct can_state {
unsigned char timer;
Psock sin,sout;
pt outputpt;
char state;
char inputbuffer[16];
};
你这样试试
再问: 不行啊,它任然会报错说psock is undefined.
再答: 结构在定义改成 typedef struct{ .... }Psock;
再问: 你的答案都不是很对,其实那天编程有些烦躁了,这几天稍微玩了一下,原来是重复定义了,包含了两次的psock的定义,所以才会出现这种情况。因为我发现psock和pt是一样定义的,但是pt是不报错的,所以我就试图删除头文件中include头文件的那一行,错误消除了,谢谢你了,还是实践出真知啊,有些时候不能死编,要思考,哈哈。
.
}Psock;
struct can_state {
unsigned char timer;
Psock sin,sout;
pt outputpt;
char state;
char inputbuffer[16];
};
你这样试试
再问: 不行啊,它任然会报错说psock is undefined.
再答: 结构在定义改成 typedef struct{ .... }Psock;
再问: 你的答案都不是很对,其实那天编程有些烦躁了,这几天稍微玩了一下,原来是重复定义了,包含了两次的psock的定义,所以才会出现这种情况。因为我发现psock和pt是一样定义的,但是pt是不报错的,所以我就试图删除头文件中include头文件的那一行,错误消除了,谢谢你了,还是实践出真知啊,有些时候不能死编,要思考,哈哈。
keil环境下,报错#70:incomplete type is not allowed,报错在struct psock
在Java中这样报错The method SayHi() is undefined for the type AccpT
keil 仿真iic bus时goto 语句报错,请帮查一下:warning C275: expression with
transfer type not allowed英译中
C++编译时出错:type name is not allowed是什么意思,怎么解决
报错c(179) :error C2275:'LNODE' :illegal use of this type as a
C# 报错 This method or property is not available because this
JSP页面报错,HTTP Status 503 - This application is not currently
matlab 报错Conversion to logical from sym is not possible.无法从
这句话报错 环境少了什么
lingo 报错 model is ill defined
环境手抄报