您的位置:首页 > 大数据 > 人工智能

linker command failed with exit code 1出错原因

2016-03-21 23:10 399 查看

一 错误提示

Ld /Users/xiaofeng/Library/Developer/Xcode/DerivedData/19-彩票-graxlvptvuraokexhzwsvioexhqu/Build/Products/Debug-iphonesimulator/19-彩票.app/19-彩票 normal x86_64
cd /Users/xiaofeng/Desktop/APP/19-彩票
export IPHONEOS_DEPLOYMENT_TARGET=9.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -L/Users/xiaofeng/Library/Developer/Xcode/DerivedData/19-彩票-graxlvptvuraokexhzwsvioexhqu/Build/Products/Debug-iphonesimulator -F/Users/xiaofeng/Library/Developer/Xcode/DerivedData/19-彩票-graxlvptvuraokexhzwsvioexhqu/Build/Products/Debug-iphonesimulator -filelist /Users/xiaofeng/Library/Developer/Xcode/DerivedData/19-彩票-graxlvptvuraokexhzwsvioexhqu/Build/Intermediates/19-彩票.build/Debug-iphonesimulator/19-彩票.build/Objects-normal/x86_64/19-彩票.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.2 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/xiaofeng/Library/Developer/Xcode/DerivedData/19-彩票-graxlvptvuraokexhzwsvioexhqu/Build/Intermediates/19-彩票.build/Debug-iphonesimulator/19-彩票.build/Objects-normal/x86_64/19-彩票_dependency_info.dat -o /Users/xiaofeng/Library/Developer/Xcode/DerivedData/19-彩票-graxlvptvuraokexhzwsvioexhqu/Build/Products/Debug-iphonesimulator/19-彩票.app/19-彩票

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_XFHallViewController", referenced from:
objc-class-ref in XFTabBarController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


二 错误原因

1 创建了类名相同的类

2 用类的时候,倒入了.m文件

3 编译的时候.m文件并没有参加编译

4 用第三方框架的时候,框架没有参与编译(.m文件)

三 解决办法

1 检查你的类名看是否有重复的

2 检查你用类别的时候导入的文件是否正确

3 将.m文件导入到编译区

图一:



图二:



四 总结

注意:用第三方框架的时候要特别的注意,特别是从别的文件中直接拖过来用,首先先编译下,看是否可以,否则等到代码写的差不多了,编译的时候出现问题,那就麻烦了.可能还有其它问题,需要的话请给我留言.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: