zlib error

Jul 30, 2013 at 5:47am
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?
Jul 30, 2013 at 10:13am
Looks like you didn't link to the zlib library correctly .
Jul 30, 2013 at 7:04pm
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?
Jul 30, 2013 at 7:15pm
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 Jul 30, 2013 at 7:18pm
Jul 30, 2013 at 7:21pm
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.