集成iOS和Google Plus SDK时链接器错误

时间:2013-06-22 03:47:01

标签: ios google-plus linker-errors armv7

我正在尝试使用Google Plus SDK在iOS 6.1应用中共享,并在添加GooglePlus.framework和GoogleOpenSource.framework后出现链接器错误。

仅仅包括框架和构建产生以下错误:

Undefined symbols for architecture armv7:
"_CGRectDivide", referenced from:
  -[GTMOAuth2ViewControllerTouch moveWebViewFromUnderNavigationBar] in GTMOAuth2ViewControllerTouch.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我按照Google guide中的说明无效。 我做了以下事情:

  1. 包含SystemConfiguration.framework和Security.framework
  2. 拖放GooglePlus.framework和GoogleOpenSource.framework 从SDK到我的XCode项目
  3. 将-ObjC标志添加到应用目标的构建设置
  4. 除了之前的步骤,我还尝试添加SDK中提供的OpenSource文件夹的内容,但无效在初始修复后引起了其他问题。

    库:

    My included libraries

    完整的错误消息:

     Ld "/Users/me/Library/Developer/Xcode/DerivedData/MyApp-asdf/Build/Intermediates/MyApp.build/
     Debug-iphoneos/MyAoo.build/Objects-normal/armv7/MyApp" normal armv7
         cd /Users/me/code/MyApp
         setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
         setenv PATH        
    
     "/Applications/Xcode.app/Contents/Developer/Platforms/
     iPhoneOS.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 armv7 -isysroot
     /Applications/Xcode.app/Contents/Developer/     
     Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk 
    
     -L/Users/me/Library/Developer/Xcode/DerivedData/
     MyApp-asdf/Build/Products/Debug-iphoneos
    
     -L/Users/me/code/MyApp/MyApp 
    
     -F/Users/me/Library/Developer/Xcode/DerivedData/MyApp-asdf/Build/Products/Debug-iphoneos 
    
     -F/Users/me/code/MyApp/../../Documents/FacebookSDK -F/Users/me/code/MyApp 
    
     -F/Users/me/code/MyApp/MyApp 
    
     -filelist "/Users/me/Library/Developer/Xcode/
     DerivedData/MyApp-asdf/Build/Intermediates/
     MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp.LinkFileList"
    
     -dead_strip -ObjC -lsqlite3.0 -fobjc-arc 
     -fobjc-link-runtime -miphoneos-version-min=6.1 
     -framework SystemConfiguration -framework Security 
     -framework CFNetwork -framework Social -framework Accounts 
     -framework EventKit -framework EventKitUI 
     -framework AVFoundation -framework MapKit  
     -framework Twitter -framework CoreMotion -framework CoreLocation 
     -lxml2 -framework QuartzCore 
     -framework MobileCoreServices -framework CoreData
     -framework UIKit -framework Foundation 
     -framework Pinterest -framework GooglePlus 
     -framework GoogleOpenSource 
     -lGooglePlusUniversal -o 
    
     "/Users/me/Library/Developer/
     Xcode/DerivedData/MyApp-asdf/Build/Intermediates/MyApp.build/
     Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp"
    
     Undefined symbols for architecture armv7:
       "_CGRectDivide", referenced from:
           -[GTMOAuth2ViewControllerTouch moveWebViewFromUnderNavigationBar] in 
       GTMOAuth2ViewControllerTouch.o
     ld: symbol(s) not found for architecture armv7
     clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    我不确定我错过了什么,但是非常感谢任何帮助。

2 个答案:

答案 0 :(得分:4)

还在CoreGraphics框架中链接。它正在寻找CGRectDivide方法,它是CoreGraphics的一部分。

答案 1 :(得分:0)

此错误是由向项目添加OpenSource文件夹引起的,xcode检测到文件重复。因此,您只应添加GooglePlus.framework和GoogleOpenSource.framework。