James Taylor
James Taylor

Reputation: 6258

/usr/bin/ld: cannot find -ll

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!

Upvotes: 2

Views: 3384

Answers (3)

Alex028502
Alex028502

Reputation: 3824

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.

Upvotes: 0

Vikas Bansal
Vikas Bansal

Reputation: 2930

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

Upvotes: 3

NP Rooski  Z
NP Rooski Z

Reputation: 3657

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

yum whatprovides "filename"

Check this answer on how to do that

Upvotes: 0

Related Questions