【发布时间】:2014-10-18 11:41:45
【问题描述】:
在.h中:
typedef struct token_t TOKEN;
在.c中:
#include "token.h"
struct token_t
{
char* start;
int length;
int type;
};
在 main.c:
#include "token.h"
int main ()
{
TOKEN* tokens; // here: ok
TOKEN token; // here: Error: incomplete type is not allowed
// ...
}
我在最后一行得到的错误:
错误:不允许不完整的类型
怎么了?
【问题讨论】:
-
发布你正在编译的参数
标签: c struct declaration typedef incomplete-type