zip压缩问题

Learn-anything 2009-02-10 04:17:01
我建立一个控制台的应用程序,然后在工程中加入unzip.cpp和unzip.h两个文件
代码如下:

#include "stdafx.h"
#include "zip.h"


int main(int argc, char* argv[])
{
HZIP hz = CreateZip("c:\\simple1.zip",0);
ZipAdd(hz,"znsimple.bmp", "c:\\simple.bmp");
ZipAdd(hz,"znsimple.txt", "c:\\simple.txt");
CloseZip(hz);

return 0;
}



可是运行会出现
error C2065: 'HZIP' : undeclared identifier
error C2501: 'DECLARE_HANDLE' : missing storage-class or type specifiers
error C2146: syntax error : missing ';' before identifier 'ZRESULT'
fatal error C1004: unexpected end of file found

这几处错误,能否帮我解决啊?

如果不明白,代码在附件中!帮忙下载下看看。谢谢
我是按下面这个网址的说法做的
http://www.80dnst.com/read.php?tid=60
...全文
257 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinahugg 2012-04-17
  • 打赏
  • 举报
回复
谢谢,俺是新手!
plutolxl 2011-03-07
  • 打赏
  • 举报
回复
好贴!感谢
fei_lu 2010-10-12
  • 打赏
  • 举报
回复
牛的很
Learn-anything 2009-02-10
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hhyttppd 的回复:]
在zip.h中加上传说中的头文件
#include <windows.h>
[/Quote]

牛,厉害!问题解决结贴
waizqfor 2009-02-10
  • 打赏
  • 举报
回复
[Quote=引用楼主 fanlehai 的帖子:]
我建立一个控制台的应用程序,然后在工程中加入unzip.cpp和unzip.h两个文件
代码如下:

C/C++ code
#include "stdafx.h"
#include "zip.h"


int main(int argc, char* argv[])
{
HZIP hz = CreateZip("c:\\simple1.zip",0);
ZipAdd(hz,"znsimple.bmp", "c:\\simple.bmp");
ZipAdd(hz,"znsimple.txt", "c:\\simple.txt");
CloseZip(hz);

return 0;
}





可是运行会出现
error C2065: 'H…
[/Quote]
连接有问题吧 你的函数有没定义上啊
检查下HZIP的定义类型的地方
hhyttppd 2009-02-10
  • 打赏
  • 举报
回复
在zip.h中加上传说中的头文件
#include <windows.h>

64,651

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧