找不到-lfl的库 [英] Library not found for -lfl

查看:357
本文介绍了找不到-lfl的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用flexbison来构建我从Github克隆的简单计算器项目.

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

但是在终端中输入make后,我收到以下消息:

But after I typed make in terminal, I got the following message:

gcc -o calc calc.tab.c lex.yy.c -lfl
calc.y:48:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main() {
^~~~
1 warning generated.
ld: library not found for -lfl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [calc] Error 1

我该如何解决这个问题?

How could I resolve this problem?

推荐答案

让我猜一猜,尝试在OS/X上使用flex?

let me guess, trying to use flex on OS/X?

尝试用-ll代替-lfl

Try -ll instead of -lfl

在OS/X上使用Flex

所以,是的,由于某些原因,OS/X上的flex库名称只是任意不同. OS/X并非完全是Linux,但非常接近.您在这里有一些选择.

So yea, the flex library name on OS/X is just arbitrarily different for some reason. OS/X is not exactly Linux, but it's pretty close. You have some options here.

  1. 您可以简单地拥有一个单独的OS/X构建系统和源文件.当然,苹果公司可能会喜欢用其推动的XCode,objective-C和不那么多的互操作性.

  1. You can just simply have a separate build system and source files for OS/X. Certainly Apple might like that with their pushing XCode, objective-C and not much interoperability.

您可以构建vs Linux,然后使用 Mac Ports

You can build vs Linux and then engage with Mac Ports and Homebrew.

您可以使用 autotools 创建项目.那不是一个很棒的链接,学习这个系统是很艰难的事情,但是对于Linux来说,这无疑是标准的事情.这确实可以正常工作,我发现如果您对此有足够的耐心,那么OS/X已经足够接近以至于基于自动工具的构建都可以在其上工作.

You can create your project using autotools. That's not an awesome link, learning this system is rough going, but it's a standard thing for Linux for sure. This will actually work, I find if you have the patience for it, OS/X is close enough that autotools based builds will work on it.

最近,我已打开 Cocoapods ,我认为这是尝试加入开源社区并XCode.大约是1和3的一半,重点是模块化外部源并将其编译为.app(通过Xcode).

Lately, I've been turned on to Cocoapods, which I believe to be an attempt to join the open source community and XCode. It's kind of half 1 and 3 sorta with an emphasis on modularizing the external source and getting it compiled into a .app (via Xcode).

这篇关于找不到-lfl的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆