网络的资料东凑西凑的
不知还少什么东西?
终端机
sudo apt-get install flex bison
然后下载网络上的lex.l、yacc.y两个档案
再开终端机
编译出这两个的.c档
请问之后要产生执行档
是用什么指令?
cc lex.yy.c y.tab.c –ocpl
gcc lex.yy.c y.tab.c –ly –ll
这两个都出错不能用
error:-ocpl : No such file or directory
error --ly : No such file or directory
error -ll : No such file or directory
lex yacc怎產生執行檔
-
- 帖子: 9
- 注册时间: 2013-10-21 11:21
- 系统: vista
- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: lex yacc怎產生執行檔
代码: 全选
cc lex.yy.c y.tab.c -o cpl -ll -ly
-
- 帖子: 9
- 注册时间: 2013-10-21 11:21
- 系统: vista
Re: lex yacc怎產生執行檔
ok 晚点试看看 谢了
希望不要是下载lex.l、yacc.y的档案本身有错误
或者ubuntu还少安装什么就好
希望不要是下载lex.l、yacc.y的档案本身有错误
或者ubuntu还少安装什么就好
-
- 帖子: 9
- 注册时间: 2013-10-21 11:21
- 系统: vista
Re: lex yacc怎產生執行檔
astolia 写了:代码: 全选
cc lex.yy.c y.tab.c -o cpl -ll -ly
In file included from lex.l:12:0:
main.h:5:31: fatal error: iostream: No such file or directory
compilation terminated.
In file included from yacc.y:12:0:
main.h:5:31: fatal error: iostream: No such file or directory
compilation terminated.

- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: lex yacc怎產生執行檔
說明你那原始碼是C++的。把cc換成cpp試試