vs2012 编译 zlib 1.2.8

1. 下载
    http://zlib.net/zlib-1.2.8.tar.gz
2. 编译
    - 解压到目录,如d:library
    - 开启VS2012的Command Prompt 
    - 进入到zlib-1.2.8contribmasmx86目录
    - 执行bld_ml32.bat
    - 打开工程项目zlib-1.2.8contribvstudiovc10zlibvc.sln

    - 编译整个solution(Release)

error LNK2026: module unsafe for SAFESEH image

1

或者使用nmake


打开“Visual Studio 命令提示(2010)”,为了使用VC2010的缺省系统配置参数;


切换目录到zlib-1.2.8contribmasmx86,并执行脚本bld_ml32.bat,此时会产生inffas32.obj和match686.obj,把这两个文件拷贝到源代码目录zlib-1.2.8下;


切换目录到zlib-1.2.8,执行

nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj"




经过以上三个步骤即可完成zlib1.2.8的编译。生成的库文件、dll文件就在源代码根目录下。

Keep it simple!
作者:N3verL4nd
知识共享,欢迎转载。
原文地址:https://www.cnblogs.com/lgh1992314/p/5834922.html