when using flex.I have compleleted my test.l and use the command flex test.l the output file is lex.yy.c then I use gcc -o test lex.yy.c -ll to compiler the file. but there is the error msg:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -ll
collect2: ld returned 1 exit status
the I found that the flex is not support the -ll lib,and we should use -lfl. or we can define int yywrap() ourselves and needn't to link the -ll lib. tip:I use yacc& lex in cygwin.cygwin will not install flex by default setting,you should check the flex lib by yourself 在cygwin中使用flex和bison的时候,突然发现gcc的时候不能链接-ll库,我们可以采用-lfl来替代-ll库.,后来在yacc &lex 2nd的时候发现。我们可以自己定义wwwrap()函数而不用链接其它的库。 注意:安装cygwin的时候并不会默认安装flex,应该在安装cygwin的时候把flex勾选上,然后才可以链接 -lfl 解决了你的问题了么?
posted on 2010-01-26 21:01  六月的星期天  阅读(1766)  评论(0编辑  收藏  举报