1

我尝试将应用程序链接到 Google APIs Objective-C 客户端库的 iOS 静态库,如此处所述。这涉及将 libGTLTouchStaticLib.a 从 Xcode Project Navigator 视图中的 GTL.xcodeproj 的 Products 区域拖到应用程序的 Link Binaries With Libraries 构建阶段。

我目前在 Xcode 5.1.1 中构建应用程序项目时遇到此错误:

ld: warning: directory not found for option  
'-L/Users/me/Library/Developer/Xcode/DerivedData/GTL-abc/Build/Products/Debug'
ld: library not found for -lGTLTouchStaticLib clang: error: linker
command failed with exit code 1 (use -v to see invocation)

进一步调查显示以下内容:

  • Xcode 将 GTL.xcodeproj 中产品 libGTLTouchStaticLib.a 的完整路径报告为 /Users/me/Library/Developer/Xcode/DerivedData/GTL-abc/Build/Products/Debug/libGTLTouchStaticLib.a(即没有后缀 -iphoneos )

  • 但是,(OS X 命令)ls将其位置报告为 /Users/me/Library/Developer/Xcode/DerivedData/GTL-abc/Build/Products/Debug-iphoneos/libGTLTouchStaticLib.a (即带有后缀 -iphoneos)

  • 拖动 libGTLTouchStaticLib.a 显然已将以下条目添加到应用程序的库搜索路径(在 Build Settings 下):$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/GTL-abc/Build/Products/Debug(即没有后缀 -iphoneos )

是什么导致两个 Xcode 项目对后缀的不同应用以及如何以“正常”方式(即不“破解”应用程序的库搜索路径)对齐它们的行为。

4

0 回答 0