www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - windows static zlib

reply mandel <foo bar.com> writes:
HI,

I like to link zlib into my application binary for windows (+mingw).

Where do I have to start, or can I just download some lib somewhere?

I tried to download libz1.dll, converted it with implib (from
ftp.digitalmars.com/bup.zip) to libz1.lib.
But when I run the exe the zlib1.dll have to be in the same folder
or I get an error message instead.

Someone suggested building zlib statically with dmc.
But that looks like an long time adventure to figure out in detail. :]
Dec 28 2007
parent reply Neal Alexander <wqeqweuqy hotmail.com> writes:
mandel wrote:
 HI,
 
 I like to link zlib into my application binary for windows (+mingw).
 
 Where do I have to start, or can I just download some lib somewhere?
 
 I tried to download libz1.dll, converted it with implib (from
ftp.digitalmars.com/bup.zip) to libz1.lib.
 But when I run the exe the zlib1.dll have to be in the same folder
 or I get an error message instead.
 
 Someone suggested building zlib statically with dmc.
 But that looks like an long time adventure to figure out in detail. :]
 
nah it builds easily. heres a lib i built months ago if youre lazy (no clue if it even works or its the right one heh): http://destroy.selfip.org/z_mars.lib heres the script i used to build it (i probably copied dependencies around). dmc -c adler32.c dmc -c compress.c dmc -c crc32.c dmc -c deflate.c dmc -c gzio.c dmc -c infback.c dmc -c inffast.c dmc -c infflate.c dmc -c inflate.c dmc -c inftrees.c dmc -c trees.c dmc -c uncompr.c dmc -c zutil.c lib -c z_mars.lib *.obj
Dec 28 2007
parent mandel <oh no.es> writes:
On Fri, 28 Dec 2007 21:48:12 -0800, Neal Alexander wrote:

 http://destroy.selfip.org/z_mars.lib
thanks!
 
 dmc -c adler32.c
 dmc -c compress.c
 dmc -c crc32.c
 dmc -c deflate.c
 dmc -c gzio.c
 dmc -c infback.c
 dmc -c inffast.c
 dmc -c infflate.c
 dmc -c inflate.c
 dmc -c inftrees.c
 dmc -c trees.c
 dmc -c uncompr.c
 dmc -c zutil.c
 lib -c z_mars.lib *.obj
that looks really easy indeed. I tried it this way but get this error message: C:\msys\1.0\home\Default\zlib-1.2.3>C:\msys\1.0\opt\dmc\dm\bin\dmc.exe -c adler32.c Error C:\msys\1.0\opt\dmc\dm\bin\..\include\unistd.h 6: "unistd.h is not for Windows use" --- errorlevel 1
Dec 29 2007