Library not found for -lfl

后端 未结 2 1927
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 10:04

I was using flex and bison to build a simple calculator project I cloned from Github.

But after I typed make in terminal, I go

2条回答
  •  情书的邮戳
    2020-12-13 10:38

    warning: type specifier missing, defaults to 'int'

    mean that you should declare return type for main function. Place int in function difinition.

    ld: library not found for -lfl

    flag -l mean that compiller must use libfl.a to build programm. As @waTeim said above, for Mac OS you can use libl.a instead, but this lib can be not exist alse. There is another way is to place

    %option noyywrap
    

    at the top of flex *.l file. In this case you can compile without additional libs.

提交回复
热议问题