Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compilation error - missing zlib.h

I am trying to compile software on Blue Gene Q using IBM XL compilers and I got this error message:

"iostreams/zlib.cpp", line 19.10: 1540-0836 (S) The #include file "zlib.h" is not found. make[3]: *** [zlib.o] Error 1 

I have installed a new version of zlib and updated LD_LIBRARY_PATH with $HOME/zlib/include

Am I missing something?

like image 537
didymos Avatar asked Aug 09 '13 13:08

didymos


People also ask

Can not find zlib H?

You have installed the library in a non-standard location ( $HOME/zlib/ ). That means the compiler will not know where your header files are and you need to tell the compiler that. You can add a path to the list that the compiler uses to search for header files by using the -I (upper-case i) option.

What is zlib H?

The 'zlib' compression library provides in-memory compression and. decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream. interface.


1 Answers

You are missing zlib.h header file, on Linux install it via:

sudo apt-get install libz-dev 

As a matter of fact, the module presents as zlib1g-dev in the apt repo, so this is the up-to-date call (Feb 2019):

sudo apt install zlib1g-dev 

On Fedora: sudo dnf install zlib-devel (in older versions: sudo dnf install libz-devel).

This will provide the development support files for a library implementing the deflate compression method found in gzip and PKZIP.

If you've already zlib library, make sure you're compiling your code sources with -lz. See: How to fix undefined references to inflate/deflate functions?.

like image 188
kenorb Avatar answered Sep 28 '22 03:09

kenorb