使用 flex-bison

问题描述

我正在尝试使用 flex/bison.i 创建一个编译器。我创建了一个词法分析器 lexical.l,在使用命令 flex lexical.l 后,我创建了一个 lex.yy.c,与解析器Syntaxique.y 我使用命令bison -d Syntaxique.y一切正常。 但是当我在我的 cmd 中输入这个命令时:gcc lex.yy.c Syntaxique.tab.c -lfl -ly -o compiler.exe 这就是显示内容

/mingw/lib/libmingw32.a(setargv.o):(.text+0x33): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x6d2): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x8b8): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x900): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xa25): undefined reference to `___chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xc15): more undefined references to `___chkstk_ms' follow
collect2: ld returned 1 exit status

问题是当我故意在 lexical.l 中添加错误并且我使用相同的命令时它会显示错误和 lign,但是当没有错误时我就剩下这个并且我无法创建一个 compiler.exe有人可以帮我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)