【发布时间】:2021-09-30 03:56:00
【问题描述】:
我有这段代码,我运行它并得到他的错误:
错误:数组类型的元素类型“结构条目”不完整
我尝试解决它并探索相同的错误但失败了
#ifndef GLOBAL_H
#define GLOBAL_H
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <getopt.h>
//list of CONSTANTS
#define BSIZE 128
#define NONE -1
#define EOS '\0'
#define NUM 256
#define DIV 257
#define MOD 258
#define ID 259
#define DONE 260
//list of prototype function
void init();
int lexan();
int lookup(char s[]);
int insert(char s[], int tok);
void emit(int t,int tval);
void parse();
void expr();
void term();
void factor();
void match(int t);
void error(char* m);
//list of variables
FILE *input, *output, *err;
int tokenval;
int lineno;
int lookahead;
extern struct entry symtable[];
struct entry {
char *lexptr;
int token;
};
#endif
我在这一行得到错误:
extern struct entry symtable[];
这是 (global.h) 的代码,其他文件不会出错
【问题讨论】:
标签: c struct compiler-errors