0

我遇到了一个问题,我在故障排除方面已经达到了我的知识的尽头,我看到了一个典型的“架构 X 的未定义 sybmols”错误,通常可以通过确保架构设置为他来轻松解决项目工作区,但它似乎在这里没有任何影响。

我的 podfile 是这样的:

platform :ios, '5.0'
pod 'CocoaLumberjack'

从 2.0 到最新的 Beta 版本,我也尝试了多个版本的 CocoaLumberjack,但均无效。

我当前的 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”都使用以下设置:

仅构建活动架构:否

架构:armv7、arm64、armv7s、x86_64

支持的平台 iOS

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

我玩过Arhitectures,并且相当多地支持architecutres。

任何帮助将不胜感激

4

1 回答 1

0

我遇到了同样的问题,但我通过File>Add Files to...将“CocoaLumberjack”文件添加到我的 XCode 项目中的方式解决了它,而不是其他方式,如拖放或其他任何方式。

基本上,我注意到主要区别在于“CocoaLumberjack”文件应该作为编译源包含在内:Build Phases>Compile Sources

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

于 2015-11-23T10:07:01.067 回答