问题描述
我在我的项目中使用了一些'.o'文件,在编译时显示以下错误:
I'm using a few '.o' files in my project and while compiling it shows the following error,
error:linker command failed with exit code 1 (use -v to see invocation)
错误日志
Ld /Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator/app.app/app normal i386
cd /Users/deepak/Workspace/iosDevelopement/PROJECTS/KML/app
setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator -F/Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator -F/Users/deepak/Workspace/iosDevelopement/PROJECTS/KML/app -filelist /Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/Objects-normal/i386/app.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=4.3 -lstdc++ -licucore -lz -framework MapKit -framework CoreLocation -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework KML -o /Users/deepak/Library/Developer/Xcode/DerivedData/app-bnwpvhpbrfdurbdgxucyddqyfosh/Build/Products/Debug-iphonesimulator/app.app/app
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZipException", referenced from:
objc-class-ref in ZipFile.o
objc-class-ref in ZipReadStream.o
objc-class-ref in ZipWriteStream.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
最初,有更多的错误,并通过导入 libs .dylib 框架,
,但仍有2个错误仍然存在。
but still 2 errors persists.
通过受欢迎的问题,但解决方案不适用于我
I had already gone through the popular question Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error ,but the solution doesn't work for me
有人知道我在哪里错了吗?
Does anyone know where I had gone wrong? I s that a problem with xcode, any missing libraries or failure in linking something?
提前感谢
推荐答案
错误消息表明未定义的符号由 ZipFile.o
, ZipReadStream.o
和 ZipWriteStream.o
。这表示您尝试在您的应用中使用库。
The error message says that the undefined symbol is referenced by ZipFile.o
, ZipReadStream.o
, and ZipWriteStream.o
. This implies that you're trying to use the Objective-Zip library in your app.
未定义的符号是 _OBJC_CLASS _ $ _ ZipException
。当在源文件中看到 @implemention ZipException
指令时,编译器会生成此符号。
The undefined symbol is _OBJC_CLASS_$_ZipException
. The compiler generates this symbol when it sees the @implemention ZipException
directive in a source file.
Objective-Zip库包含一个名为 ZipException.m
的文件,其中包含 @implementation ZipException
指令。
The Objective-Zip library includes a file named ZipException.m
, which contains the @implementation ZipException
directive.
最可能的解释是你只是没有在目标中包含 ZipException.m
。检查您是否已这样做。如果您不知道如何操作,请查看。
The most likely explanation is that you simply haven't included ZipException.m
in your target. Check that you have done so. If you don't know how, look at this answer.
另一个可能的解释是你修改了 ZipException.m
文件,也许不小心,删除 @implementation ZipException
指令或隐藏它从编译器。检查您是否尚未修改该文件,并且它包含 @implementation ZipException
指令。
Another possible explanation is that you have modified the ZipException.m
file, perhaps accidentally, in a way that removes the @implementation ZipException
directive or hides it from the compiler. Check that you have not modified the file, and that it contains the @implementation ZipException
directive.
这篇关于架构i386的未定义符号:“_OBJC_CLASS _ $ _ ZipException”,引用自:error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!