ld: symbol(s) not found for architecture armv7s

XCODE4升级到XCODE5编译就不通过了错误如下:

ld: warning: directory not found for option '-L/Users/paul/Android/baidu_tongji_source/ios-sdk/BaiduMobStatSample/../BaiduMobStat/DerivedData/BaiduMobStat/Build/Products/Debug-iphoneos'

ld: warning: ignoring file /Users/paul/Library/Developer/Xcode/DerivedData/BaiduMobStatSample-eqytpjphifilvcdgslntagloteig/Build/Products/Debug-iphoneos/libBaiduMobStat.a, file was built for archive which is not the architecture being linked (armv7s): /Users/paul/Library/Developer/Xcode/DerivedData/BaiduMobStatSample-eqytpjphifilvcdgslntagloteig/Build/Products/Debug-iphoneos/libBaiduMobStat.a

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)



解决方法:

     进入Build Settings 找到Architectures 选择Standard architectures

找到Valid Architectures选择armv7和armv7s两项,其余删除

此时clean工程 编译如果还出现该错误,请找到Build Active Architecture Only项选择YES,然后编译通过后再改回NO。之后就正常了。


你可能感兴趣的:(IOS)