通过CocoaPods链接iOS项目和CocoaLumberjack,未定义的架构

时间:2015-10-13 14:29:12

标签: ios linker cocoalumberjack

我遇到了一个问题而且我已经在我的故障排除方面达到了我的最终知识,我看到了一个典型的“未定义的架构X sybmols”错误,这通常很容易通过确保架构是set int他的项目工作区,但它似乎没有任何影响。

我的podfile是这样的:

platform :ios, '5.0'
pod 'CocoaLumberjack'

我也试过几个版本的CocoaLumberjack无法使用,从2.0到最新的Beta版本。

我目前的Cocoapods版本是0.39.0.rc.1,再次,我尝试了多个版本。

CocoaLumberjack包含在我的AppDelegate.m中:

#import <CocoaLumberjack/CocoaLumberjack.h>

并通过以下方式引用:

[DDLog addLogger:[DDASLLogger sharedInstance]];

我正在使用XCode 7.0(7A220) 错误如下所示:

Ld /Users/xceph/Library/Developer/Xcode/DerivedData/MyProject-dxhidbgfhzkukyeaiirdnjduposm/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/x86_64/MyProject normal x86_64
    cd /Users/xceph/MyProject-iOS
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    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.0.sdk -L/Users/xceph/Library/Developer/Xcode/DerivedData/MyProject-dxhidbgfhzkukyeaiirdnjduposm/Build/Products/Debug-iphonesimulator -L/Users/xceph/MyProject-iOS -L/Users/xceph/MyProject-iOS/GoogleLibrary -F/Users/xceph/Library/Developer/Xcode/DerivedData/MyProject-dxhidbgfhzkukyeaiirdnjduposm/Build/Products/Debug-iphonesimulator -F/Users/xceph/MyProject-iOS -F/Users/xceph/MyProject-iOS/FacebookSDK -filelist /Users/xceph/Library/Developer/Xcode/DerivedData/MyProject-dxhidbgfhzkukyeaiirdnjduposm/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/x86_64/MyProject.LinkFileList -mios-simulator-version-min=7.0 -Xlinker -objc_abi_version -Xlinker 2 -all_load -fobjc-link-runtime -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/xceph/Library/Developer/Xcode/DerivedData/MyProject-dxhidbgfhzkukyeaiirdnjduposm/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/MyProject.app.xcent -framework CoreData -framework ShinobiEssentials -lstdc++.6 -framework ShinobiCharts -framework CoreText -lstdc++ -framework ShinobiGauges -framework AVFoundation -licucore -framework OpenGLES -framework CFNetwork -lsqlite3 -framework Foundation -framework UIKit -framework CoreGraphics -framework ExternalAccessory -framework QuartzCore -framework MessageUI -framework SystemConfiguration -framework StoreKit -lPayPalMPL -framework Security -lz.1.1.3 -lGoogleAnalyticsServices -lxml2.2 -framework DropboxSDK -framework FacebookSDK -framework ShinobiGrids -framework Crashlytics -lPods -Xlinker -dependency_info -Xlinker /Users/xceph/Library/Developer/Xcode/DerivedData/MyProject-dxhidbgfhzkukyeaiirdnjduposm/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/x86_64/MyProject_dependency_info.dat -o /Users/xceph/Library/Developer/Xcode/DerivedData/MyProject-dxhidbgfhzkukyeaiirdnjduposm/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/x86_64/MyProject

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

MyProject和“Pods”都使用这些设置:

仅构建Active Arhitecture:否

架构:armv7,arm64,armv7s,x86_64

支持的平台iOS

有效架构:armv7,arm64,armv7s,x86_64

我玩过Arhitectures,并且支持了很多架构。

任何帮助都会得到帮助

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,但我通过文件&gt;将文件添加到... 而不是像拖放或其他方式将“CocoaLumberjack”文件添加到我的XCode项目的方式解决了它别的什么。

基本上,我注意到主要的区别是“CocoaLumberjack”文件应作为编译源包含在内:构建阶段&gt;编译源

当你这样做时,我推荐的方式是XCode自动添加它们。