我尝试使用Extractzipfile插件:https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ExtractZipFile
但是当我在sdk 6.1中使用Xcode 4.6.1进行编译时,它会抛出一个错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SSZipArchive", referenced from:
objc-class-ref in ExtractZipFilePlugin.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我尝试在此处执行此问题:Undefined symbols for architecture armv7 SSZipArchive
但它显示了另一个错误:
/Users/alienware/Desktop/ExtractZipFile/SSZipArchive/Tests/SSZipArchiveTests.m:10:9:找不到'SenTestingKit / SenTestingKit.h'文件
我使用phonegap,我在iOS上制作应用,我是转储。
更新的: 我尝试将SSZipArchive.m添加到编译器源代码中,这就出现了新的错误:
Undefined symbols for architecture i386:
"_unzClose", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzCloseCurrentFile", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzGetCurrentFileInfo", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzGetGlobalInfo", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzGoToFirstFile", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzGoToNextFile", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzOpen", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzOpenCurrentFile", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzOpenCurrentFilePassword", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_unzReadCurrentFile", referenced from:
+[SSZipArchive unzipFileAtPath:toDestination:overwrite:password:error:delegate:] in SSZipArchive.o
"_zipClose", referenced from:
-[SSZipArchive close] in SSZipArchive.o
"_zipCloseFileInZip", referenced from:
-[SSZipArchive writeFile:] in SSZipArchive.o
-[SSZipArchive writeData:filename:] in SSZipArchive.o
"_zipOpen", referenced from:
-[SSZipArchive open] in SSZipArchive.o
"_zipOpenNewFileInZip", referenced from:
-[SSZipArchive writeFile:] in SSZipArchive.o
-[SSZipArchive writeData:filename:] in SSZipArchive.o
"_zipWriteInFileInZip", referenced from:
-[SSZipArchive writeFile:] in SSZipArchive.o
-[SSZipArchive writeData:filename:] in SSZipArchive.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
答案 0 :(得分:4)
转到项目设置>转到Build Phases选项卡,然后编译Sources并确保将该类拖到列表中。
答案 1 :(得分:1)
我有同样的问题,这是你必须做的。在您的项目中,创建一个名为SSZipArchive的自己的组(文件夹),并将2个主类文件拖放到其中。然后在SSZipArchive中创建一个名为minizip的子文件夹,现在将minizip中的文件拖放到此文件夹中。基本上,源代码中的文件夹需要手动创建......
答案 2 :(得分:0)
据我所知,由于以下原因之一,会发生此错误
1.如果您忘记在VC类中导入任何库。 2.Forgot在项目中添加所需的库。 3.Forgot正确设置标题搜索(意味着您添加了Extractzipfile插件,所以显然您必须在项目中获取此库的路径并且必须在标题搜索路径中设置)
所以请检查这些事情。一切顺利。