简体   繁体   English

/usr/bin/ld: 找不到 -ll

[英]/usr/bin/ld: cannot find -ll

I'm running make which passes the following flags to ld :我正在运行make ,它将以下标志传递给ld

LDLIBS=-ll -ldl -lreadline -lcurses

However, when running make , the linker fails with:但是,在运行make ,链接器失败并显示:

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

I'm really not sure what shared object library -ll is referring to nor sure how to go about figuring it out.我真的不确定共享对象库-ll指的是什么,也不知道如何弄清楚它。

I'm trying this on a CentOS machine, so I tried to install the 'Development Tools' package, thinking it must be something pretty generic:我正在 CentOS 机器上尝试这个,所以我尝试安装'Development Tools'包,认为它一定是非常通用的:

sudo yum groupinstall 'Development Tools'

But with no avail.但无济于事。

Where / what is the library?图书馆在哪里/什么是图书馆? Any help would be greatly appreciated!任何帮助将不胜感激! Thanks!谢谢!

You can find what file is provided by what package using following command: 您可以使用以下命令找到由哪个包提供的文件:

yum whatprovides "filename"

Check this answer on how to do that 检查这个答案如何做到这一点

Try re-installing Bison and flex. 尝试重新安装Bison和flex。
sudo apt-get remove bison flex sudo apt-get install bison flex
It worked for me. 它对我有用。

TL;DR give sudo apt-get install libfl-dev . TL;DR 给sudo apt-get install libfl-dev a shot if you find this questiona and are using ubuntu如果您发现这个问题并且正在使用 ubuntu,请试一试


I got this on ubuntu (on github actions) but wasn't getting it locally.我在 ubuntu(在 github 操作上)上得到了这个,但没有在本地得到它。

and from reading a few answers I found out that libl.a what is missing, so I tracked it down to this package on my local system.通过阅读一些答案,我发现libl.a缺少什么,因此我将其追踪到本地系统上的这个包。

/usr/lib$ dpkg -S /usr/lib/x86_64-linux-gnu/libl.a
libfl-dev:amd64: /usr/lib/x86_64-linux-gnu/libl.a

So I fixed github actions with sudo apt-get install libfl-dev .因此,我使用sudo apt-get install libfl-dev修复了 github 操作。

Locally it says it is a dependency of flex which I have.在本地,它说这是我对flex的依赖。 I am not sure if that is just because I am on the LTS version locally, and using latest for CI.我不确定这是否只是因为我在本地使用 LTS 版本,并且使用latest的 CI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM