iOS中的一些关于"Linker"的报错

来源:互联网 发布:518抽奖软件注册码 编辑:程序博客网 时间:2024/05/17 23:29

iOS中的一些关于”Linker”的报错

最近群里有好多关于linker报错的问题, 但是Xcode又不能定位到错误地方, 只好到网上一点一点的爬贴了, 然后做一下记录

  • 首先出现这样的错误的情况, 你要知道是添加第三方库时引起的

    • 问题一:

      使用Cocoapods管理项目,编译运行debug都没问题,就是不能Archive,报错如下      ld: library not found for -lPodsclang: error: linker command failed with exit code 1 (use -v to see invocation)

      解决方法

      修改Build Setting > Other Linker Flag:$(TARGET_BUILD_DIR) to $(BUILT_PRODUCTS_DIR).参考:http://stackoverflow.com/questions/14644122/cant-archive-on-xcode-cocoapods-linking-error
    • 问题二 :

      错误信息如下:
      Undefined symbols for architecture armv7s:
      "_OBJC_CLASS_$_BaiduMobStat", referenced from:
      objc-class-ref in BaiduMobStatAppDelegate.o
      objc-class-ref in MyPageLogViewController.o
      (maybe you meant: _OBJC_CLASS_$_BaiduMobStatAppDelegate)
      ld: symbol(s) not found for architecture armv7s
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      报此错误是因为你选的SDK不支持armv7s,在Bulid Settings 中Valid Architectures 中把armv7s删除就行了
      现在Xcode已经升级到5.1了,如果用6.1SDK就会报ld: symbol(s) not found for architecture arm64的错误,这个目前比较常见,按以上的办法就可以解决了

先这么多, 以后遇到了慢慢更新

0 0
原创粉丝点击