Linker Command failed with exit code 1

1.当xcode编译出现这种错误提示的时候,右击问题-->Reveal in Log 查看详细的错误信息c++

 

2.经过log能够看到错误缘由是:ld: library not found for -lstdc++.6.0.9xcode

 

 

3.出现这种错误的缘由是:app

苹果在XCode10和iOS12中移除了libstdc++这个库,由libc++这个库取而代之,优化

苹果的解释是libstdc++已经标记为废弃有5年了,建议你们使用通过了llvm优化过而且全面支持C++11的libc++库。code

解决方法:将xcode9中 libstdc++ 库导入到xcode10中orm

Xcode10支持手机:blog

将以下三个文件拷贝到:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/get

libstdc++.6.0.9.tbdio

libstdc++.6.tbd编译

libstdc++.tbd

这三个文件从Xcode9中--显示包内容获取。或者点此连接下载

 Xcode10支持模拟器:

方法和支持手机的同样,只是拷贝的路径不一样

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
分别从Xcode9中相应的路径将这三个文件拷贝到Xcode10中相应的路径里
相关文章
相关标签/搜索