iOS开发错误集-objc-class-ref in AppDelegate.o之解决方案

释放双眼,带上耳机,听听看~!

最近查看老项目Xcode版本从Xcode6.N进级到Xcode7.2后,顺序编译报错,出现问题:其实就是一个很常见的问题,很多项目在替换Xcode版本后都有如下报错

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_QQApiInterface", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_ShareSDK", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in RecipeDetailViewController.o
objc-class-ref in showViewController.o
objc-class-ref in video_show.o
"_OBJC_CLASS_$_TencentOAuth", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_WXApi", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_WeiboApi", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_YXApi", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

比如:Xcode升级到6.1.1 默认让所有App都通过64位编译器编译。原来在Xcode6.0的时候默认的Architectures只有(arm7,armv7s),到6.1.1默认就带上arm64的参数了。

解决方案:


Architectures


  • 1 .选中Targets—>Build Settings—>Architectures。

把build active architectures only 改为 NO。

  • 2 . 把最下面的Valid Architectures中的arm64参数删掉就可以了

    或者:
    ‘双击

    Architectures

    选择other,删除

    $(ARCH_STANDARD)

    然后增加armv7和armv7s(写上:$(ARCHS_STANDARD_32_BIT))。

    设置如图:

  • 3.clean 再build。

 

人已赞赏
iOS文章

iOS .pch 文件找不到 XCTest/XCTest.h' file not found ..

2020-5-14 18:16:51

iOS文章

iOS-推送通知

2020-5-14 19:31:49

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索