在xcode9 升级 xcode10 以上版本或者维护比较旧项目时时报错library not found for -lstdc++.6.0.9或者 library not found for -lstdc++,这是因为Xcode10以上版本中libstdc++.6.0.9
和libstdc++
被移除,Frameworks中libstdc++.6.0.9
和libstdc++
找不到对应的库。
解决方法:1.将Xcode9中拷贝 -lstdc++.6.0.9
以及libstdc++
等库到Xcode10中。文件位置 :
真机:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
模拟器:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
注意:模拟器和真机都需要拷贝
这种方法有一个弊端就是别人下载了你的项目,也需要重新搞一次上述操作,所以我们提出下面方法,直接将libstdc++.6.0.9导入项目,然后引用,这样就不用每次都要重新配置了。
本文地址:https://blog.csdn.net/xyanq2222/article/details/108119088
黄山市民网:https://www.huangshanshimin.com/