1

我正在尝试使用 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 指南中的说明进行操作,但无济于事。我做了以下事情:

  1. 包括 SystemConfiguration.framework 和 Security.framework
  2. 将 SDK 中的 GooglePlus.framework 和 GoogleOpenSource.framework 拖放到我的 XCode 项目中
  3. 在应用程序目标的构建设置中添加了 -ObjC 标志

除了前面的步骤,我还尝试添加 SDK 中提供的 OpenSource 文件夹的内容,但是没有效果在初始修复后导致其他问题。

图书馆:

我包含的库

完整的错误信息:

 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)

我不确定我错过了什么,但任何帮助将不胜感激。

4

2 回答 2

4

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

于 2013-06-22T03:54:29.020 回答
0

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

于 2015-01-06T14:47:09.947 回答