【发布时间】:2012-06-04 10:18:43
【问题描述】:
我尝试使用 make 文件编译 C 代码。我收到以下错误:
/home/dev5/src/ermparselex.c:69: error: initializer element is not constant
/home/dev5/src/ermparselex.c:69: error: (near initialization for âyyinâ)
代码 sn-p 以及行号:
65 int yyleng; extern char yytext[];
66 int yymorfg;
67 extern char *yysptr, yysbuf[];
68 int yytchar;
69 FILE *yyin = stdin, *yyout = stdout;
70 extern int yylineno;
71 struct yysvf {
72 struct yywork *yystoff;
73 struct yysvf *yyother;
74 int *yystops;};
75 struct yysvf *yyestate;
76 extern struct yysvf yysvec[], *yybgin;
stdin 和 stdout 的值未在此代码中的任何位置定义。
我无法从谷歌获得适当的解决方案。知道为什么会发生此错误吗?
【问题讨论】:
-
你使用的
lex/flex和gcc是什么版本的? -
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44),flex 版本 2.5.4
-
您好,伊格纳西奥,感谢您的回复。我不确定你到底是什么意思。
标签: linux gcc initializer