News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MASM32 and zLib

Started by bigboss-62, November 07, 2008, 03:02:16 PM

Previous topic - Next topic

bigboss-62

Hello,
I'm trying to use zLib in masm32 with zLib.lib static lib.
I have created zLib.inc like this:
Quote
include                     \masm32\include\kernel32.inc
include                     \masm32\include\msvcrt.inc
includelib                  \masm32\lib\kernel32.lib
includelib                  \masm32\lib\msvcrt.lib
compress                        Proto C : PBYTE , : PULONG, : PBYTE , : ULONG
compress2                       Proto C : PBYTE , : PULONG, : PBYTE , : ULONG, : DWORD
uncompress                      Proto C : PBYTE , : PULONG, : PBYTE , : ULONG
gzopen                          Proto C : PBYTE , : PBYTE

When I'm trying to compile my asm file, I've got error on "gzopen" function call:
QuotezLIB.lib(gzio.o) : error LNK2001: unresolved external symbol __alloca
zLIB.lib(gzio.o) : error LNK2001: unresolved external symbol _fdopen
The problem is linked to msvcrt, but it's defined in zLib.inc.
How can I solve it ?

MichaelW

The MASM32 msvcrt.lib is an import library. As far as I know you will need to link with a static library that contains the necessary functions.
eschew obfuscation

fearless

Its hard to source a static zlib.lib for the current version as the current version expects the zlib1.dll to be present (in current folder or in path like windows\system32). Previous versions have a static lib from what i recall. I have searched a good bit for a static zlib.lib for the current version but couldnt find one.

There is a previous post regarding using the current version and the proto's used: http://www.masm32.com/board/index.php?topic=9039.0 hope that helps
Ć’earless

jj2007

I wonder if somebody has tried to use the lzma/7-zip dll from Masm? LZMA has by far the best compromise between speed and compression, but using the dll seems very tricky. Igor Pavlov seems not eager to write a proper MSDN-style manual. There is a manual for 7-zip32.dll in somewhat hilarious English here. The dll itself sits here.

fearless

In relation to the zlib static library i found one the other day that KetilO has with his RadASM v3.x package for the addin - update checker. Can be found in the masm example projects included with the distribution. May be of use to someone looking for a static library version of zlib. The folder also contains an include file with it as well, which at a glance looks like it has everything defined that you might need for using zlib functions.
Ć’earless