3.17.2 win32 unzip 不能使用

新建工程,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

这个我也是遇到了,对比了以前的版本,没发现有什么问题,我看引擎FileUtil里也有调用这个接口,但同样的写法就说无法解析

我也碰到了 就升级了下项目 出了这个错 有人知道怎么解决吗

同问~

同问 ~

请问找到解决方法了吗

请问找到解决方法了吗
@minggo

unzip/unzip.h
line 47
unzip/ioapi.h
line 25

#define CC_DLL
替换
#ifndef CC_DLL
#define CC_DLL
#endif // !CC_DLL

可以编译通过

1赞