一:ld: library not found for -lstdc++.6.0.9
clang: error: linker command failed with exit code 1 (use -v to see invocation)
原因:
苹果在XCode10和iOS12中移除了libstdc++
这个库,由libc++
这个库取而代之,
苹果的解释是libstdc++
已经标记为废弃有5年了,建议大家使用经过了llvm优化过并且全面支持C++11的libc++
库。
解决
拷贝缺失的 libstdc++
、libstdc++.6
、libstdc++6.0.9
从XCode9的目录里,把缺失的.tbd文件拷贝过来,要记得拷贝2套,一套是模拟器的,一套是设备的,
下载地址连接 链接: https://pan.baidu.com/s/18LFfY9B83vNV04BCukilLw 提取码: ptjf
下载后拷贝到路径下:
真机
/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/