我在项目中使用了一些“.o”文件,在编译时显示以下错误,
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)
最初错误较多,通过导入解决库.dylib框架,
但仍然存在 2 个错误。
编辑:我已经解决了这个热门问题体系结构 i386 的未定义符号:_OBJC_CLASS_$_SKPSMTPMessage”,引用自:错误 https://stackoverflow.com/questions/6984368/undefined-symbols-for-architecture-i386-objc-class-skpsmtpmessage-refere,但该解决方案对我不起作用
有谁知道我哪里出了问题?这是 xcode 的问题吗?缺少任何库或链接失败吗?
提前致谢
错误消息表明未定义的符号被引用ZipFile.o
, ZipReadStream.o
, and ZipWriteStream.o
。这意味着您正在尝试使用Objective-Zip https://github.com/AgileBits/objective-zip/tree/master/Objective-Zip您的应用程序中的库。
未定义的符号是_OBJC_CLASS_$_ZipException
。当编译器看到这个符号时,它会生成这个符号@implemention ZipException
源文件中的指令。
Objective-Zip 库包含一个名为ZipException.m
,其中包含@implementation ZipException
指示。
最可能的解释是你根本没有包括ZipException.m
在你的目标中。检查您是否已这样做。如果你不知道怎么做,请看这个答案 https://stackoverflow.com/a/14148008/77567.
另一种可能的解释是您修改了ZipException.m
文件,也许是意外地,以删除的方式@implementation ZipException
指令或对编译器隐藏它。检查您是否未修改该文件,并且它包含@implementation ZipException
指示。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)