ld:找不到-lc ++ clang的库:错误:链接器命令失败,退出代码为1(使用-v查看调用)

时间:2016-06-29 08:49:31

标签: swift google-cloud-messaging

这表明当我运行带有连接设备的应用时:

Ld DerivedData/TestPods/Build/Products/Debug-iphoneos/TestPods.app/TestPods normal arm64
    cd /Users/tannaz/Developments/TestPods
    export IPHONEOS_DEPLOYMENT_TARGET=9.3
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos -L/Users/tannaz/Developments/TestPods/Pods/GGLInstanceID/Libraries -L/Users/tannaz/Developments/TestPods/Pods/Google/Libraries -L/Users/tannaz/Developments/TestPods/Pods/GoogleCloudMessaging/Libraries -F/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos -F/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos/Alamofire -F/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos/JTFadingInfoView -F/Users/tannaz/Developments/TestPods/Pods/GoogleIPhoneUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleInterchangeUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleNetworkingUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleSymbolUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleUtilities/Frameworks -filelist /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Intermediates/TestPods.build/Debug-iphoneos/TestPods.build/Objects-normal/arm64/TestPods.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.3 -dead_strip -Xlinker -no_deduplicate -ObjC -lGGLCloudMessaging -lGGLCore -lGGLInstanceIDLib -lGcmLib -lsqlite3 -lstdc++ -lz -framework AddressBook -framework Alamofire -framework AssetsLibrary -framework CoreFoundation -framework CoreGraphics -framework CoreLocation -framework CoreMotion -framework GoogleIPhoneUtilities -framework GoogleInterchangeUtilities -framework GoogleNetworkingUtilities -framework GoogleSymbolUtilities -framework GoogleUtilities -framework JTFadingInfoView -framework MessageUI -framework Security -framework SystemConfiguration -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Intermediates/TestPods.build/Debug-iphoneos/TestPods.build/Objects-normal/arm64/TestPods.swiftmodule -framework Pods_TestPods -Xlinker -dependency_info -Xlinker /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Intermediates/TestPods.build/Debug-iphoneos/TestPods.build/Objects-normal/arm64/TestPods_dependency_info.dat -o /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos/TestPods.app/TestPods

ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:0)

由于项目中缺少某些库,因此出现此错误。检查构建阶段,然后将二进制文件链接到库。链接器找不到可能被移动或删除的框架。

添加缺少的库。清理并构建您的项目。

检查这些相关的门票:

  

解决这个问题:

     
      
  1. 转到项目设置页面
  2.   
  3. 选择您的项目(左侧)
  4.   
  5. 点击“构建设置”标签
  6.   
  7. 搜索“Bitcode”
  8.   
  9. 将“启用Bitcode”设置为“否”
  10.   

希望这有帮助!