Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"/usr/bin/ld: cannot find -lz"

Tags:

linux

gcc

linker

People also ask

How do you resolve usr bin Ld Cannot find?

“/usr/bin/ld cannot find -lltdl” Error and Solution The “/usr/bin/ld cannot find -lltdl” error is related to the C development library named ltdl-dev . So installing the libtdl-dev can resolve this error.

What is LZ in Linux?

lz provides a listing of a gzip'd tar'd archive, that is a tar(1) archive compressed with the gzip(1) utility. It is not strictly necessary on Debian GNU/Linux, because the GNU tar(1) program provides the same capability with the command. tar -tzf file.


I had the exact same error, and like you, installing zlib1g-dev did not fix it. Installing lib32z1-dev got me past it. I have a 64 bit system and it seems like it wanted the 32 bit library.


For x64 install zlib1g-dev.

sudo apt-get install zlib1g-dev

I don't need all the x86 libs ;)


sudo apt-get install libz-dev in ubuntu.


I just encountered this problem and contrary to the accepted solution of "your make files are broken" and "host includes should never be included in a cross compile"

The android build includes many host executables used by the SDK to build an android app. In my case the make stopped while building zipalign, which is used to optimize an apk before installing on an android device.

Installing lib32z1-dev solved my problem, under Ubuntu you can install it with the following command:

sudo apt-get install lib32z1-dev

I had the exact same error, Installing zlib-devel solved my problem, Type the command and install zlib package.

On linux:

sudo apt-get install zlib*

On Centos:

sudo yum install zlib*

Try one of those three solution. It must work :) :

  1. sudo apt-get install zlib1g-dev
  2. sudo apt-get install libz-dev
  3. sudo apt-get install lib32z1-dev

In fact what is missing is not the lz command, but the development files for the zlib library.So you should install zlib1g-devlib for ex to get it.

For rhel7 like systems the package is zlib-devel