Undefined reference to 'inflateInit2_'
Use the option -L<path>
to tell the linker where to find libz.so.x.y.z
.
For your reference: http://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
you can see where your zlib is installed like this :
/sbin/ldconfig -p| grep libz.so
it should find one or more entries if installed, otherwise it will return blank line