首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

lex and yacc编译异常,gcc: compilation of header file requested

2012-10-09 
lex and yacc编译错误,gcc: compilation of header file requested我用的编译命令:yacc -d ctops.ylex cto

lex and yacc编译错误,gcc: compilation of header file requested
我用的编译命令:
yacc -d ctops.y
lex ctops.l
gcc y.tab.c lex.yy.c y.tab.h -o ctops
出现的错误:
gcc: compilation of header file requested

lex部分:
%{
#include "y.tab.h"
void stocke_commentaire();
char contenu[100];

int count;

%}
yacc部分:
%{
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include"structeurs.h"
FILE* yyin;
FILE* yyout;
extern noeudType* noeud_premiere;
extern char contenu[100];
extern int count;
noeudType* creer_noeud_reel (float value);

noeudType* creer_noeud_operateur (int numop,...);

noeudType* creer_noeud_identificateur(char* valuer);

noeudType* creer_noeud_definir (noeudType* noeud1,noeudType* noeud2);

int transformerCtoPostScript(noeudType* noeud,FILE* file);

noeudType* creer_noeud_commentaire(char* valeur);

void yyerror(char *s);

int yylex(void);

%}

[解决办法]
gcc y.tab.c lex.yy.c y.tab.h -o ctops
改为
gcc y.tab.c lex.yy.c -o ctops

热点排行