问题描述
我是应用程序开发的新手,但是我是一位经验丰富的其他语言的开发人员.我已经下载了一个比我正在使用的旧版本XCode编写的示例项目.它通过CocoaPods链接到AFNetworking,并且在进行进一步更改之前尝试运行基本项目时,出现Mach-O Linker错误.我已经尝试了在其他线程上看到的几件事,并且每次编译项目时都出现相同的错误.有人可以帮忙吗?错误如下:
I am new to app development, but I am a seasoned developer in other languages. I've downloaded a sample project written in an older version of XCode than I'm using. It is linking through CocoaPods to AFNetworking and when I try and run the basic project before making further changes I get a Mach-O Linker error. I've tried several things I've seen on other threads and the project compiles with the same error every time. Can someone help please? Error is as follows:
Ld/Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Objects-normal/i386/RWPuppies普通i386 cd"/用户/dickiebow/文档/XCode项目/RWPuppies" 出口IPHONEOS_DEPLOYMENT_TARGET = 6.0 导出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/iPhoneSimulator8. 0.sdk -L/Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Products/Debug-iphonesimulator -F/Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPups-dn产品/调试iphone模拟器-文件列表/用户/dickiebow/库/开发人员/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Objects-Normal/i386/List Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework Foundation -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min = 6.0 -framework UIKit -framework Foundation -框架 CoreGraphics -lPods -Xlinker -dependency_info -Xlinker/Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Object数据-o/Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Objects-normal/i386/RWPuppies
Ld /Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Objects-normal/i386/RWPuppies normal i386 cd "/Users/dickiebow/Documents/XCode Projects/RWPuppies" export IPHONEOS_DEPLOYMENT_TARGET=6.0 export 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/iPhoneSimulator8.0.sdk -L/Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Products/Debug-iphonesimulator -F/Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Products/Debug-iphonesimulator -filelist /Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Objects-normal/i386/RWPuppies.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework Foundation -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework UIKit -framework Foundation -framework CoreGraphics -lPods -Xlinker -dependency_info -Xlinker /Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Objects-normal/i386/RWPuppies_dependency_info.dat -o /Users/dickiebow/Library/Developer/Xcode/DerivedData/RWPuppies-dnhsukxxlqrjhzhiympqasxkyrsp/Build/Intermediates/RWPuppies.build/Debug-iphonesimulator/RWPuppies.build/Objects-normal/i386/RWPuppies
ld:找不到-lPods的库clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
ld: library not found for -lPodsclang: error: linker command failed with exit code 1 (use -v to see invocation)
推荐答案
问题在于CocoaPod架构与主项目不同步.一旦将它们都设置为相同,则项目将成功编译.这篇文章非常有帮助. http://www.schiffhauer.com/debugging-xcode-and- cocoapods-architecture-issues/
The problem was with the CocoaPod Architectures being out of sync with the main project. Once they were all set the same the project compiled successfully. This article was very helpful. http://www.schiffhauer.com/debugging-xcode-and-cocoapods-architecture-issues/
这篇关于Mach-O链接器链接到Pod时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!