1

在调用解压缩类中的函数时,我在构建 cocos2d-x win32 项目时遇到链接器错误。

   1>ZipArchive.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void * __cdecl cocos2d::unzOpen(char const *)" (__imp_?unzOpen@cocos2d@@YAPAXPBD@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzGetGlobalInfo(void *,struct cocos2d::unz_global_info_s *)" (__imp_?unzGetGlobalInfo@cocos2d@@YAHPAXPAUunz_global_info_s@1@@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipOpenFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?UnzipOpenFile@ZipArchive@myproject@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzReadCurrentFile(void *,void *,unsigned int)" (__imp_?unzReadCurrentFile@cocos2d@@YAHPAX0I@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipFileTo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?UnzipFileTo@ZipArchive@myproject@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzGoToNextFile(void *)" (__imp_?unzGoToNextFile@cocos2d@@YAHPAX@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipFileTo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?UnzipFileTo@ZipArchive@myproject@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzGetCurrentFileInfo(void *,struct cocos2d::unz_file_info_s *,char *,unsigned long,void *,unsigned long,char *,unsigned long)" (__imp_?unzGetCurrentFileInfo@cocos2d@@YAHPAXPAUunz_file_info_s@1@PADK0K2K@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipFileTo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?UnzipFileTo@ZipArchive@myproject@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzOpenCurrentFilePassword(void *,char const *)" (__imp_?unzOpenCurrentFilePassword@cocos2d@@YAHPAXPBD@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipFileTo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?UnzipFileTo@ZipArchive@myproject@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzOpenCurrentFile(void *)" (__imp_?unzOpenCurrentFile@cocos2d@@YAHPAX@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipFileTo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?UnzipFileTo@ZipArchive@myproject@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzGoToFirstFile(void *)" (__imp_?unzGoToFirstFile@cocos2d@@YAHPAX@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipFileTo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?UnzipFileTo@ZipArchive@myproject@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
1>ZipArchive.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl cocos2d::unzClose(void *)" (__imp_?unzClose@cocos2d@@YAHPAX@Z) referenced in function "public: bool __thiscall myproject::ZipArchive::UnzipCloseFile(void)" (?UnzipCloseFile@ZipArchive@myproject@@QAE_NXZ)

我将 libzlib.lib 添加到我的附加依赖项中,但它仍然给我错误。我正在使用 VS2010

4

0 回答 0