XCode10 运行app报错

文章详细介绍了如何解决Xcode10及其以上版本对libstdc++库支持的问题,通过复制特定库文件并修改BuildPhases中的设置,确保老代码在新环境中正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  原因很简单:Xcode10起,苹果摒弃了对libstdc++库的支持转而支持libc++库了。为了保证老代码能跑,必须将几个库复制到对应文件夹(见后)。同时修改Build Phases中的Link Binary With Libraries小节,增加对libstdc++的3个库的引用

  相应文件下载url:https://github.com/codesourse/libstdc-

  这个链接包含一个脚本,运行后搞定一切。

  详细知识点:从Xcode10不再支持libstdc++说起

动态库:

目录:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
文件:
ibstdc++.dylib,libstdc++.6.dylib,libstdc++.6.0.9.dylib

真机:

目录:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
文件:libstdc++.tbd,libstdc++.6.tbd,libstdc++.6.0.9.tbd

模拟器:

目录:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
文件:
libstdc++.tbd,libstdc++.6.tbd,libstdc++.6.0.9.tbd

 

转载于:https://www.cnblogs.com/badwood316/p/10345280.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值