ios – ld:找不到-lstdc .6的库

Xcode版本更新到10.0 beta后,开始获取“ld:找不到-lstdc .6的库”错误.相同的代码在Xcode 9.2中正常工作

还将macOS更新为10.13.5

解决方法

定位iOS应用时,您会遇到此问题.发布说明中说明了这一点:

Deprecation Notices:

Building with libstdc++ was deprecated with Xcode 8 and is not
supported in Xcode 10 when targeting iOS
. C++ projects must Now
migrate to libc++ and are recommended to set a deployment target of
iOS 7 or later. Besides changing the C++ Standard Library build
setting,developers should audit hard-coded linker flags and target
dependencies to remove references to libstdc++ (including -lstdc++,
-lstdc++.6.0.9,libstdc++.6.0.9.tbd,and libstdc++.6.0.9.dylib). Project dependencies such as static archives that were built against
libstdc++ will also need to be rebuilt against libc++. (40885260)

资料来源:Release Notes of XCode Beta 2

边注:
您需要登录才能访问该页面.
链接可能在下一个测试版中中断(URL更改),但它位于开发人员/下载部分

XCode 10正式发布其release note,它仍然如此:

Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must Now migrate to libc++ and are recommended to set a deployment target of macOS 10.9 or later,or iOS 7 or later. Besides changing the C++ Standard Library build setting,developers should audit hard-coded linker flags and target dependencies to remove references to libstdc++ (including -lstdc++,-lstdc++.6.0.9,and libstdc++.6.0.9.dylib). Project dependencies such as static archives that were built against libstdc++ will also need to be rebuilt against libc++. (40885260)

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...