Jake Jake - 1 year ago 316
C++ Question

`undefined reference to `inflateInit2_` - zlib in C++

I'm using Code Blocks IDE and I want to install Tiled Map Editor for SFML. So, I downloaded the source and imported it to my project. Unfortunately, the build finished with an error due to missing zlib library. I downloaded it and built again. This time I received an error that reads:

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

On the Internet I found the advice to join the linker command
, but the compiler refuses throwing the error: cannot find -lz. Does anyone know how to fix it?


alk alk
Answer Source

Use the option -L<path> to tell the compiler where to find libz.so.x.y.z.

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download