我正在尝试为跨平台应用程序归档文件,看起来 Minizip(基于 zlib 构建)与归档器一样可移植。
但是,当我尝试运行以下虚拟代码时,出现系统错误[my executable] has stopped working. Windows can check online for a solution to the problem.
谁能帮我看看如何使用这个库?—(我找不到任何文档或教程)
zip_fileinfo zfi;
int main()
{
zipFile zf = zipOpen("myarch.zip",APPEND_STATUS_ADDINZIP);
int ret = zipOpenNewFileInZip(zf,
"myfile.txt",
&zfi,
NULL, 0,
NULL, 0,
"my comment for this interior file",
Z_DEFLATED,
Z_NO_COMPRESSION
);
zipCloseFileInZip(zf);
zipClose(zf, "my comment for exterior file");
return 0;
}
规格:Msys + MinGW,Windows 7,使用 zlib125dll.zip/dll32 中的 zlibwapi.dll