美文网首页
iOS Xcode编译报错 Undefined symbols

iOS Xcode编译报错 Undefined symbols

作者: 雷尘子 | 来源:发表于2018-02-10 14:43 被阅读0次

    缺少StoreKit.framework,编译报错:

    Undefined symbols for architecture armv7:

    "_OBJC_CLASS_$_SKPayment", referenced from:

    objc-class-ref in IAPHelper.o

    "_OBJC_CLASS_$_SKProductsRequest", referenced from:

    objc-class-ref in IAPHelper.o

    "_OBJC_CLASS_$_SKPaymentQueue", referenced from:

    objc-class-ref in IAPHelper.o

    ld: symbol(s) not found for architecture armv7

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    缺少StoreKit.framework报错

    Cocos2dx-2.2.5编译报错:_curl_rule_01_ declared as an array with a negative size

    curlrules.h报错

    解决方案:在Valid Architectures下面删除arm64

    移除arm64

    真机测试提示:This application does not support this device’s CPU type.

    不支持CPU type

    未找到解决方案(cocos2d-x-2.2.5项目使用Xcode7、Xcode9在iOS11.2.1手机上测试,都会报这个错误)

    解决方案:在Valid Architectures下面添加arm64,但是又会报错: _curl_rule_01_ declared as an array with a negative size(某些版本报错,cocos2dx-2.2.6正常运行)

    有人说替换引擎的curl文件夹下的所有.h 文件,再把libcurl.a添加到工程中,即可解决这问题

    网上一种解释如下:

    It seems likely that you’re building your app as 32 bit.  iOS 11 no longer supports 32-bit apps; you’ll have to build a 64-bit version.

    In your project check the value of the Valid Architectures (VALID_ARCHS) and Architectures (ARCHS) build settings.  The default values should do the right thing, so if you have any customisations you should remove them and try again.

    It’s possible that building a 64-bit app will require some code changes on your part.  The 64-Bit Transition Guide for Cocoa Touch has info about that.

    网上的一种解释

    真机测试提示 :Could not  write to the  device .

    解决方案:clean一下项目或者重启Xcode

    相关文章

      网友评论

          本文标题:iOS Xcode编译报错 Undefined symbols

          本文链接:https://www.haomeiwen.com/subject/nmictftx.html