Leo Liu How to use ZipUtils.h in game?
Posts 6
Added by Leo Liu 11 months ago

I used ZipUtils in my game like this:
#include "support/zip_support/ZipUtils.h"
int lenth = ZipUtils::ccInflateMemory(data, dataLength, &uncompressData);

but some error happened:

1>HelloWorldScene.obj : error LNK2019: unresolved external symbol "public: static int __cdecl cocos2d::ZipUtils::ccInflateMemory(unsigned char *,unsigned int,unsigned char * *)" (?ccInflateMemory@ZipUtils@cocos2d@SAHPAEIPAPAE@Z) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@UAE_NXZ)
1>E:\cocos2d-1.0.1-x-0.12.0\Debug.win32\gzipTest.win32.exe : fatal error LNK1120: 1 unresolved externals

Minggo Zhang RE: How to use ZipUtils.h in game?
Posts 1641
Added by Minggo Zhang 11 months ago

Because this class is not exported.
You can change

class ZipUtils

to
class CC_DLL ZipUtils

Leo Liu RE: How to use ZipUtils.h in game?
Posts 6
Added by Leo Liu 11 months ago

think you, but it still have error.:(
error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int _cdecl cocos2d::ZipUtils::ccInflateMemoryWithHint(unsigned char *,unsigned int,unsigned char * *,unsigned int)" (_imp_?ccInflateMemoryWithHint@ZipUtils@cocos2d@SAHPAEIPAPAEI@Z) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@UAE_NXZ)

Leo Liu RE: How to use ZipUtils.h in game?
Posts 6
Added by Leo Liu 11 months ago

Minggo Zhang wrote:

Because this class is not exported.
You can change
[...]
to
[...]

it doesn't work after add CC_DLL.:(
this error just in Win32. it work well in android.


(1-3/3)