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。之后就正常了。
--------------------
经过测试,Build Active Architecture Only项选择YES后不能改回NO,改回NO编译仍然不通过。
本文解决Xcode4升级至Xcode5后出现的编译错误问题,包括ld警告和未定义符号错误。通过调整BuildSettings中的Architectures设置,可以修复编译问题。
652

被折叠的 条评论
为什么被折叠?



