Cannot find -ly error

China☆狼群 提交于 2019-12-16 18:03:45

问题


I am trying to run a lexx and yacc program and I got the following error:

/usr/bin/ld: cannot find -ly
collect2: error: ld returned 1 exit status

Plz tell me which libraries am I supposed to add?


回答1:


I would guess the problem is that you're using a version of yacc other than the old AT&T yacc which doesn't come with liby (the -ly you have). So you need to remove the -ly option from your command line, and provide your own implementations of main and yyerror.




回答2:


What version of yacc and lex have the "-ly" parametr? I used this command in my university:

gcc gram.c gram.h sem.c -ly -ll or cc gram.c gram.h sem.c -ly -ll

And works! But on my home komputer doesn't work..



来源:https://stackoverflow.com/questions/18877798/cannot-find-ly-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!