You should install the development support files for zlib, try:

sudo apt-get install libz-dev

Other package names: zlib1g-dev.

If you've already zlib library, make sure you're compiling your code sources with -lz. See: missing zlib.h in ubuntu.

Answer from kenorb on Stack Overflow
🌐
Ask Ubuntu
askubuntu.com › questions › 1124866 › ubuntu-bionic-18-04-fatal-error-zlib-h-no-such-file-or-directory-include
compiling - Ubuntu Bionic 18.04 -- fatal error: zlib.h: No such file or directory #include <zlib.h> - Ask Ubuntu
March 11, 2019 - So it looks like you have an anaconda3 toolchain that is taking over the build process (preventing the regular "system" toolchain from running). Unless that's intentional, I suggest you examine your ~/.bashrc and (at least temporarily) comment ...
🌐
GitHub
github.com › tidyverse › haven › issues › 656
Installation error using install.packages("tidyverse"): "fatal error: zlib.h: No such file or directory" · Issue #656 · tidyverse/haven
January 18, 2022 - Installation error using install.packages("tidyverse"): "fatal error: zlib.h: No such file or directory"#656
Author   tidyverse
🌐
TechOverflow
techoverflow.net › 2022 › 04 › 06 › how-to-fix-r-package-installation-fatal-error-zlib-h-no-such-file-or-directory
How to fix R package installation fatal error: zlib.h: No such file or directory | TechOverflow
April 6, 2022 - io_utils.c:16:10: fatal error: zlib.h: No such file or directory 16 | #include <zlib.h> | ^~~~~~~~ compilation terminated. make: *** [/usr/lib/R/etc/Makeconf:168: io_utils.o] Error 1 · You need to install the zlib development headers.
🌐
SvennD
svennd.be › fatal-error-zlib-h-no-such-file-or-directory
fatal error: zlib.h: No such file or directory - SvennD
May 7, 2018 - fatal error: zlib.h: No such file or directory · Missing dependency ! I wish some tool would help out and tell you, what library I was missing, so I could stop making these posts. As to the solution : yum install zlib-devel · for debian : apt-get install libz-dev ·
🌐
GitHub
github.com › dfguan › asset › issues › 5
zlib.h: No such file or directory · Issue #5 · dfguan/asset
December 12, 2020 - zlib.h: No such file or directory#5 · Copy link · zhoudreames · opened · on Dec 12, 2020 · Issue body actions · I got a error when I have runned make,below this error. gcc -g -Wall -D VERBOSE -O2 -D PRINT_COVERAGE -c -o paf.o paf.c paf.c:1:10: fatal error: zlib.h: No such file or directory #include <zlib.h> ^~~~~~~~ compilation terminated.
Author   dfguan
🌐
Stack Overflow
stackoverflow.com › questions › 58713475 › opencv-error-zlib-h-no-such-file-or-directory
OpenCV error zlib.h: no such file or directory - Stack Overflow
https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/ ... In file included from /home/gosztolai/opencv/3rdparty/libpng/pngpriv.h:913:0, from /home/gosztolai/opencv/3rdparty/libpng/png.c:14: /home/gosztolai/opencv/3rdparty/libpng/pngstruct.h:30:10: fatal error: zlib.h: No such file or directory #include "zlib.h"
🌐
CrazyGeeks
crazygeeks.org › questions › how-to-fix-fatal-error-zlib-h-no-such-file-or-directory
How to fix fatal error: zlib.h: no such file or directory? - CrazyGeeks
April 10, 2020 - If you've already zlib library, make sure you're compiling your code sources with -lz. See: missing zlib.h in ubuntu.
Find elsewhere
🌐
GitHub
github.com › grenaud › leeHom › issues › 8
fatal error: zlib.h: No such file or directory · Issue #8 · grenaud/leeHom
September 18, 2018 - /home/georgia/bin/leeHom-master/bamtools/src/api/internal/io/BgzfStream_p.cpp:20:10: fatal error: zlib.h: No such file or directory #include <zlib.h> ^~~~~~~~ compilation terminated.
Author   grenaud
🌐
GitHub
github.com › BioInf-Wuerzburg › proovread › issues › 145
fatal error: zlib.h: No such file or directory · Issue #145 · BioInf-Wuerzburg/proovread
September 25, 2019 - linux@linux-virtual-machine:~/proovread$ make && make install git submodule init git submodule update --force Submodule path 'util/SeqChunker': checked out '676b02085c50d540223e5d648250e91c5749ccfe' Submodule path 'util/SeqFilter': checked out 'add13966d77f7d348368883213e156fc7034abc9' Submodule path 'util/bwa': checked out 'a0aadf47802aa45e5157562ee3f7099fe4b823af' cd util/bwa && make make[1]: Entering directory '/home/linux/proovread/util/bwa' gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS utils.c -o utils.o utils.c:33:10: fatal error: zlib.h: No such file or directory #include <zlib.h> ^~~~~~~~ compilation terminated.
Author   BioInf-Wuerzburg
🌐
GitHub
github.com › ghdl › ghdl › issues › 248
./configure does not complain about missing zlib.h · Issue #248 · ghdl/ghdl
February 12, 2021 - On Ubuntu Trusty ./configure finishes without errors but compilation fails if zlib1g-dev is not installed. (trusty-xorg)petteri@localhost:~/Share/ghdl$ ./configure Build machine is: x86_64-linux-gn...
Author   ghdl
🌐
GitHub
github.com › dtrace4linux › linux › issues › 81
fatal error: zlib.h: No such file or directory · Issue #81 · dtrace4linux/linux
April 5, 2014 - I am getting fatal error: zlib.h: No such file or directory on make all step. Here is the a bit more detailed output BUILD_DIR=build-3.5.0-46-generic tools/build.pl build-3.5.0-46-generic `uname -m...
Author   dtrace4linux
🌐
Stack Overflow
stackoverflow.com › questions › 54337293 › fatal-error-zlib-h-no-such-file-or-directory-when-zlib-is-installed › 54340522
gcc - fatal error: zlib.h: No such file or directory when zlib is installed - Stack Overflow
> make make -C lib/utils libutils.a make[1]: Entering directory '/common/apps/biscuit/lib/utils' gcc -c -Wall -O2 wzvcf.c -o wzvcf.o In file included from wzvcf.h:29:0, from wzvcf.c:1: wzio.h:4:10: fatal error: zlib.h: No such file or directory #include <zlib.h> ^~~~~~~~ compilation terminated.
🌐
Bioinformatics Answers
biostars.org › p › 414753
fwrite.c:10:49: fatal error: zlib.h: No such file or directory #include <zlib.h> // for compression to .gz
fwrite.c:10:49: fatal error: zlib.h: No such file or directory #include <zlib.h> // for compression to .gz 0
🌐
GitHub
github.com › conan-io › conan › issues › 13886
[question] fatal error: zlib.h: No such file or directory | #include <zlib.h> · Issue #13886 · conan-io/conan
May 13, 2023 - cmake_minimum_required(VERSION 3.15) project(hello CXX) add_library(hello src/hello.cpp) target_include_directories(hello PUBLIC include) find_package(ZLIB) target_link_libraries(hello PRIVATE ${ZLIB_LIBRARIES}) set_target_properties(hello PROPERTIES PUBLIC_HEADER "include/hello.h") install(TARGETS hello)
Author   conan-io
🌐
GitHub
github.com › mapsme › omim › issues › 6181
Build Error: 'zlib.h' file not found · Issue #6181 · mapsme/omim
June 2, 2017 - [At Ubuntu 14.04] gcc -c -pipe -fdata-sections -ffunction-sections -O3 -ffloat-store -g -fPIC -w -D_REENTRANT -DFT2_BUILD_LIBRARY -DRELEASE -D_RELEASE -DNDEBUG -DOMIM_FULL_FREETYPE -DQT_NO_DEBUG -I/home//dev/omim/3party/freetype -I. -I/home//dev/omim/3party/freetype/include -I/home//dev/omim -I/home//dev/omim/3party/boost -I/home//dev/omim/3party/glm -I/opt/qt55/mkspecs/linux-g++ -o ../../out/release/tmp/freetype/ftgzip.o /home//dev/omim/3party/freetype/src/gzip/ftgzip.c make[2]: Leaving directory /home/***/dev/omim-build-release/3party/freetype' make[1]: Leaving directory /home/***/dev/omim-build-release/3party' sh: 1: g++: not found /home/***/dev/omim/3party/freetype/src/gzip/ftgzip.c:50:18: fatal error: zlib.h: No such file or directory #include <zlib.h> ^ compilation terminated.
Author   mapsme