How to fix fatal error: zlib.h: no such file or directory?

user3043108 picture user3043108 · Apr 2, 2016 · Viewed 56.7k times · Source

I'm trying to compile miniSAT on Kali Linux 64 bits but I keep getting the error message:

fatal error: zlib.h: no such file or directory

I have read that there might be a linking problem that makes the compiler unable to find the header files, but I'm new to Linux and do not know how to solve that.

Answer

kenorb picture kenorb · Jul 9, 2016

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.