新建工程,appdelegate 增加代码
#ifdef MINIZIP_FROM_SYSTEM
#include <minizip/unzip.h>
#else // from our embedded sources
#include “external/unzip/unzip.h”
#endif
#define BUFFER_SIZE 8192
#define MAX_FILENAME 512
bool uncompress(string outFileName, string _storagePath)
{
// Open the zip file
unzFile zipfile = unzOpen(FileUtils::getInstance()->getSuitableFOpen(outFileName).c_str());
if (!zipfile)
{
CCLOG("can not open downloaded zip file %s", outFileName.c_str());
return false;
}
return true;
}
而后报错
严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2019 无法解析的外部符号 "void * __cdecl cocos2d::unzOpen(char const *)" (?unzOpen@cocos2d@@YAPAXPBD@Z),该符号在函数 "bool __cdecl uncompress(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?uncompress@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) 中被引用 testlua E:\testlua\frameworks\runtime-src\proj.win32\AppDelegate.obj 1