是因为XCode 10中已经移除了libstdc++(libstdc++.6、libstdc++6.0.9)库。
解决方法一:
删除libstdc++(libstdc++.6、libstdc++6.0.9)库,然后添加libc++库
解决方法二:
将Xcode 9中的6.0.9丢到Xcode中,然后重启Xcode。(需注意这个分真机和模拟器)
链接: https://pan.baidu.com/s/1Cloc3i7KwGQPaVrdUGI3yw 提取码: wj1e
真机
/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
Xcode 10 ld: library not found for -lstdc++.6
library not found for -lstdc++.6.0.9
library not found for -lstdc++.6
library not found for -lstdc++
都是一样的问题,-lstdc++.6.dylib
和-lstdc++.dylib
都是libstdc++.6.0.9.dylib
的替身
右键我们刚才加入的
libstdc++.6.0.9.dylib
制作替身,然后制作两个替身,分别改名为libstdc++.6.dylib
和libstdc++.dylib
,模拟器和真机是一样的道理,只不过路径不同,完事之后run一下就可以了。