2

I'm running make which passes the following flags to ld:

LDLIBS=-ll -ldl -lreadline -lcurses

However, when running make, the linker fails with:

/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.

I'm trying this on a CentOS machine, so I tried to install the 'Development Tools' package, thinking it must be something pretty generic:

sudo yum groupinstall 'Development Tools'

But with no avail.

Where / what is the library? Any help would be greatly appreciated! Thanks!

alk
  • 69,737
  • 10
  • 105
  • 255
James Taylor
  • 6,158
  • 8
  • 48
  • 74
  • I believe `libl` (which `-ll` is trying to pull in) is part of Solaris. Not sure there's a Linux equivalent. – Tavian Barnes Sep 26 '16 at 01:54
  • Are you getting this makefile from some library or project? `-ll` would suggest something called `libl` is expected, which online searching suggests would be for `lex`. I don't use CentOS/Redhat, but I'd go for generic build libs, `flex` and/or `bison`. –  Sep 26 '16 at 01:55
  • It appears that `'Development Tools'` comes with `flex` and `bison`, so those dependencies have already been satisfied. Also, no matches found from `yum whatprovides libl`. Appreciate the input! – James Taylor Sep 26 '16 at 01:57
  • The dependencies can be satisfied, but they must be in the PATH searched by the makefile in order to be found. I'd check to make sure that the path to libl is either available in that path, modify the path to contain that file, or explicitly path to it. –  Sep 26 '16 at 02:06
  • what package are you trying to build? – JamesWebbTelescopeAlien Sep 26 '16 at 02:15
  • I'm not really sure what the dependency is for. I'm setting up a project that a friend was developing on. I will look into modifying my `PATH`. – James Taylor Sep 26 '16 at 02:18
  • You can just try removing -ll and see what warnings you get - if any. The new warnings will be specific missing symbols that are much more informative. – technosaurus Sep 10 '19 at 03:29

3 Answers3

2

Try re-installing Bison and flex.
sudo apt-get remove bison flex sudo apt-get install bison flex
It worked for me.

Vikas Bansal
  • 2,184
  • 2
  • 15
  • 18
0

You can find what file is provided by what package using following command:

yum whatprovides "filename"

Check this answer on how to do that

Community
  • 1
  • 1
JamesWebbTelescopeAlien
  • 3,547
  • 2
  • 30
  • 51
  • I did `yum whatprovides l` (because the library would just be called `l`) and got `No matches found`. – James Taylor Sep 26 '16 at 01:53
  • Looks like it is something related to lex http://docs.oracle.com/cd/E36784_01/html/E36873/libl-3lib.html. So you need to install lex/yacc support on your machine – JamesWebbTelescopeAlien Sep 26 '16 at 02:03
  • I believe I did this through `yum`, but thanks for the pointer. I will verify that it actually placed it in a default shared library space visible to `ld`. – James Taylor Sep 26 '16 at 02:20
0

TL;DR give sudo apt-get install libfl-dev. a shot if you find this questiona and are using ubuntu


I got this on ubuntu (on github actions) but wasn't getting it locally.

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.

/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.

Locally it says it is a dependency of flex which I have. I am not sure if that is just because I am on the LTS version locally, and using latest for CI.

Alex028502
  • 3,486
  • 2
  • 23
  • 50
  • On Debian, the dependency is libfl-dev is a recommended package for flex, not installed if you use `--no-install-recommends`. – Dereckson Jan 23 '22 at 15:46