Undefined reference to 'inflateInit2_'

I am using the Code Blocks IDE and want to install the Tiled Map Editor for SFML. So, I downloaded the source code and imported it into my project. Unfortunately, the assembly failed because of the lack of the zlib library. I downloaded it and put it together again. This time I received an error message:

undefined reference to 'inflateInit2_'| undefined reference to 'inflateEnd'| undefined reference to 'inflateEnd'| 

I found advice on the Internet to join the -lz linker -lz , but the compiler refuses to throw an error: cannot find -lz. Does anyone know how to fix this?

+6
source share
2 answers

Use the -L<path> parameter to tell the compiler where to find libz.so.xyz .

For reference: http://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

+3
source

you can see where zlib is installed:

 /sbin/ldconfig -p| grep libz.so 

he must find one or more entries, if installed, otherwise it will return an empty string

0
source

All Articles