You need to install -dev package for zlib1g - it is named zlib1g-dev:

sudo apt-get install zlib1g-dev

and it will install zlib.pc file for pkg-config along with zlib.h header.

Answer from N0rbert on askubuntu.com
🌐
GitHub
github.com › netdata › netdata › issues › 24
zlib not found, but installed · Issue #24 · netdata/netdata
November 16, 2015 - PTHREAD_CREATE_JOINABLE checking ... were not met: No package 'zlib' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix....
Author   netdata
Discussions

c - Error while configuring libpng: "zlib not installed" - Stack Overflow
OS: Win7, using MinGW, sh.exe from MSYS ./configure --prefix=/mingw with and without prefix ends like this: checking for zlibVersion in -lz... no checking for yeszlibVersion in -lz... no config... More on stackoverflow.com
🌐 stackoverflow.com
configure: error: zlib not installed
Bug reports: Trying to install Wine on Mac OS X 10.12 and I keep getting this error... I'm pretty much a complete 0 when it comes to programming, I was following someones guide on how to do it. che... More on github.com
🌐 github.com
1
October 2, 2016
anaconda - zlib not found when installing ShortRead - Stack Overflow
I am using R (3.4.3) installed via anaconda (version 5.2). I have installed zlib using conda already. But when trying to install the Bioconductor R package: "ShortRead" I am getting this error: checking for gzeof in -lz... no configure: error: zlib not found ERROR: configuration failed for package ... More on stackoverflow.com
🌐 stackoverflow.com
r - configure: error: zlib development files not found - Stack Overflow
I'm trying to install RSEM software. To compile RSEM, I ran "make", then I got the following error: [configure: error: zlib development files not found Samtools uses compression routines from the ... More on stackoverflow.com
🌐 stackoverflow.com
Top answer
1 of 5
1
I'd ensure that this was seen by R, and that the header for libz (typically, installing the '-dev' version of the library) are available. · As a next step, if from the command line and with the unpacked source tarball available you try to install the package · > download.packages("ShortRead", ".", repos = BiocInstaller::biocinstallRepos()) · > quit() · $ tar xzf ShortRead_*gz · $ cd ShortRead · ShortRead$ R CMD INSTALL . · and then look for config.log you'll see something like · configure:2897: checking for gzeof in -lz · configure:2922: gcc -o conftest -g -O2 conftest.c -lz >&5 · configure:2922: $? = 0 · configure:2931: result: yes · except that you won't get that result, and there'll be a conftest.c file and perhaps informative messages. I'd also look on the mailing list / support site for whatever 'conda' manager you're using for similar messages.
2 of 5
1
I had what seems to be the exact same problem, installing ShortRead in a conda environment. I was able to solve the problem for myself, so I hope this can help others having the same issue. · Long story short, this error seems to happen with zlib v1.2.11 but not zlib v1.2.8. So I made sure my environment was using this version: · $ conda create -n myenv zlib=1.2.8 · After this, installing ShortRead worked fine. · $ source activate myenv · $ R · > source("https://bioconductor.org/biocLite.R") · > biocLite("ShortRead") · Note that it might be possible to downgrade zlib: · $ conda install -c anaconda zlib=1.2.8 · However, in my case this broke some other packages, which is why I had to create an entirely new environment. Hope this helps.
🌐
GitHub
github.com › Homebrew › homebrew-core › issues › 5498
configure: error: zlib not installed · Issue #5498 · Homebrew/homebrew-core
October 2, 2016 - Bug reports: Trying to install Wine on Mac OS X 10.12 and I keep getting this error... I'm pretty much a complete 0 when it comes to programming, I was following someones guide on how to do it. checking for zlibVersion in -lz... no check...
Author   Homebrew
🌐
Linux Questions
linuxquestions.org › questions › linux-software-2 › zlib-not-found-when-running-configure-249972
zlib not found when running ./configure
Hi All, Okay, so I'm having this strange problem. I downloaded the source for Celestia at celestia.sourceforge.net and I'm attempting to compile it. I
Top answer
1 of 3
2

I believe that the problem lies with the configuration of autotools in r-base>3.4.1b2, but I'm not competent to fix that. The plus side is that, although configure can't find zlib during the pre-installation, zlib is actually present in any Conda environment with r-base and can be linked during the actual installation. I filed an issue at Conda-Forge, but until and unless the issue is resolved in r-base, I made a fork of ShortRead which skips the check. It works for me with r-base=3.5.1.

tldr: remotes::install_github("brendanf/ShortRead")

2 of 3
0

I had the same error for the past week. I tried every thing that was mentioned regarding the zlib library on the internet. I couldn't fix it properly. I have the zlib installed as when I run: pkg-config zlib --libs; I get as output: -lz $ pkg-config zlib --libs -lz

I am running conda (v4.5.4). R version 3.4.3 and I have R as a conda environment. I think the problem is with multiple zlib libraries (ubuntu base and conda).

Somehow I just made this to work. What I did was to install R in ubuntu shell (i.e. outside conda) and install the ShortRead library there. There was no conflict/error with the zlib. After that I added the core Rlib directories to libPaths in conda.

$.libPaths(c('/home/aridaman/.conda/envs/rstudio/lib/R/library','/usr/local/lib/R/site-library/','/usr/lib/R/site-library','/usr/lib/R/site-library'))

This is not ideal but somehow worked for me. I would be glad to have a better conda based solution.

Find elsewhere
🌐
Ubuntu Forums
ubuntuforums.org › archive › index.php › t-2217198.html
[SOLVED] problem: configure could not find the zlib library [Archive] - Ubuntu Forums
April 16, 2014 - It wasn't the version of zlib, though it was worth looking into. Instead, it was that pkg-config from lscsoft was overwriting pkg-config from the apt repos. I reinstalled pkg-config and added the following to my .bashrc: export PKG_CONFIG=/usr/bin/pkg-config After logging off and then back on, I was able to run the configure script and install without any errors.
🌐
Stack Overflow
stackoverflow.com › questions › 49062227 › configure-error-zlib-development-files-not-found
r - configure: error: zlib development files not found - Stack Overflow
To compile RSEM, I ran "make", ... on the build machine; you may need to ensure a package such as zlib1g-dev (on Debian or Ubuntu Linux) or zlib-devel (on RPM-based Linux distributions) is installed.]...
🌐
Stack Overflow
stackoverflow.com › questions › 76053947 › trouble-installwhen-i-install-libpng-in-cygwin64configure-error-zlib-not-inst
cygwin - trouble installwhen I install libpng in Cygwin64:configure: error: zlib not installed - Stack Overflow
$ cygcheck -c zlib0 zlib-devel Cygwin Package Information Package Version Status zlib-devel 1.2.13-1 OK zlib0 1.2.13-1 OK · If both are OK, than you need to look inside the config.log written by configure to understand why the test failed. Please note that the package you are trying to build is already available in cygwin
🌐
GitHub
github.com › vysheng › tg › issues › 1650
No zlib found · Issue #1650 · vysheng/tg
March 10, 2020 - joker@debianSRV:~/tg$ ./configure checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compilin...
Author   vysheng
🌐
Fedora Discussion
discussion.fedoraproject.org › ask fedora
Zlib installed, but not installed bug - Fedora Discussion
April 14, 2024 - testing Fedora 40 on testing machine and it fails to install since it wants zlib and that is installed, but when i query on it results are not installed Place your right index finger on the fingerprint reader Last metadata expiration check: 1:57:21 ago on Wed 10 Apr 2024 02:40:44 PM +07.
Top answer
1 of 2
1

The configure option --prefix is used to tell the configure script (and the resulting makefiles) where to put the programs which will be installed. It does not tell where to get header-files and libraries.

To tell the configure script where to get files, you may have to adjust these variables:

  • CPPFLAGS (for directories containing header-files)
  • LDFLAGS (for directories containing libraries)
  • LIBS (for the actual library names)

You can pass those values on the command-line to configure, e.g.,

myheader=$HOME/junk/include
mylibs=$HOME/junk/lib
./configure CPPFLAGS="-I$myheader" LDFLAGS="-L$mylibs"

Following up on the clarification (which should have been incorporated into the question)

when I try to build the files in dropbear by running

#!/bin/bash ./configure --prefix=$HOME/Hi3536_SDK_V2.0.4.0/dropbear --with-zlib=$HOME/Hi3536_SDK_V2.0.4.0/zlib/include --host=arm CC=arm-hisiv400-linux-gcc

but it seems that it's unable to local the path to zlib

You can see the problem by looking at the source for the configure script:

# Check if zlib is needed
AC_ARG_WITH(zlib,
    [  --with-zlib=PATH        Use zlib in PATH],
    [
        # option is given
        if test -d "$withval/lib"; then
            LDFLAGS="-L${withval}/lib ${LDFLAGS}"
        else
            LDFLAGS="-L${withval} ${LDFLAGS}"
        fi
        if test -d "$withval/include"; then
            CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
        else
            CPPFLAGS="-I${withval} ${CPPFLAGS}"
        fi
    ]
)

That is, it expects the option value to be the pathname of a directory which contains both the include and lib subdirectories (or a directory containing the files expected to be in those subdirectories). The comment shows that the given value was the pathname of the include (sub)directory. The following compile/link check will fail:

AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))

The likely fix: change that option to

--with-zlib=$HOME/Hi3536_SDK_V2.0.4.0/zlib
2 of 2
0

Check the config.log file. Odds are, you'll find repeated error messages about -Wno-pointer-sign.

What's happening isn't that configure is failing to find zlib, it's that configure is expecting a newer version of GCC than you're using, and GCC is erroring out on the unrecognized command-line option. All the tests are failing, it's just that the test for zlib is the first one where failure is fatal.

To fix this, edit the configure script to remove -Wno-pointer-sign from the CFLAGS parameters (for me, it was on line 3135).

🌐
DirectAdmin
forum.directadmin.com › home › forums › technical discussion › general technical discussion & troubleshooting
zlib not found but it's there | DirectAdmin Forums
September 21, 2007 - So I'd recommend trying to install a precompiled binary. If you do want to compile your own, this is the configure line: ... ./configure --prefix=${PREFIX} --with-png=/usr/local/lib --with-gdlib=/usr/local/lib --with-gd=/usr/local/include --enable-dns --with-dblib --with-db --with-z-inc --with-zlib note that --with-zlib has no path argument.