zlib error

I stole the zlib example inflate code from zpipe.c I have all my imports in order(the same ones from zpipe.c) and I have there binary corruption fix at the top like it should be, but I get this error:

obj\Debug\ArchiveIO.o||In function `Z10DecompressP6_iobufS0_':|
C:\Users\Owner\Documents\CodeBlocks\Projects\Trek Setup\ArchiveIO.cpp|30|undefined reference to `inflateInit_'|
C:\Users\Owner\Documents\CodeBlocks\Projects\Trek Setup\ArchiveIO.cpp|38|undefined reference to `inflateEnd'|
C:\Users\Owner\Documents\CodeBlocks\Projects\Trek Setup\ArchiveIO.cpp|49|undefined reference to `inflate'|
C:\Users\Owner\Documents\CodeBlocks\Projects\Trek Setup\ArchiveIO.cpp|56|undefined reference to `inflateEnd'|
C:\Users\Owner\Documents\CodeBlocks\Projects\Trek Setup\ArchiveIO.cpp|61|undefined reference to `inflateEnd'|
C:\Users\Owner\Documents\CodeBlocks\Projects\Trek Setup\ArchiveIO.cpp|70|undefined reference to `inflateEnd'|
||=== Build finished: 6 errors, 0 warnings (0 minutes, 1 seconds) ===|

any idea why?
Looks like you didn't link to the zlib library correctly .
Yup, I figured that out, do you have any idea how to statically link zlib without having to add the entire source to my project?
You should just need to link to the static version of the zlib library file.

Assumes you've built the libs, of course?

Andy

PS MinGW: Compiling Zlib
http://kemovitra.blogspot.co.uk/2009/06/mingw-compiling-zlib.html
Last edited on
If you don't find using a slighly olf version of zlib, there are prebuilt libs for MinGW here:
http://sourceforge.net/projects/gnuwin32/files/zlib/1.2.3/

Andy
Topic archived. No new replies allowed.