CMake zlib build on Windows

According to https://wiki.apache.org/httpd/Win64Compilation a very similar error means:

This means you have a typo in either -DASMV -DASMINF or your OBJ="inffasx64.obj gvmat64.obj inffas8664.obj" since inflate_fast is defined in inffas8664.c.


I was able to successfully build with a simple:

mkdir C:\Builds\zlib; cd C:\Builds\zlib
cmake -G "Visual Studio 12 2013" -A x64 D:\Downloads\zlib-1.2.8\
cmake --build .

I looked at my cmake cache and I see that AMD64 is set to false, unlike what your cmake-gui window shows. Setting it to true it results all kinds of build errors for me, though not the ones you show.

CMakeLists.txt says this option is to enable an AMD64 assembly implementation. Just doing without this seems to be the easiest solution.


You need contrib\masmx64\inffas8664.c included in visual studio project file. This file contains inflate_fast function which calls corresponding asm functions.