在Xcode9上正常编译的项目,在Xcode10上编译可能会遇到以下错误:c++
library not found for -lstdc++.6.0.9 library not found for -lstdc++.6 library not found for -lstdc++
这是由于Xcode10完全废弃了libstdc++
,相关的库文件libstdc++.6.0.9.dylib
、libstdc++.6.dylib
、libstdc++.dylib
、libstdc++.6.0.9.tbd
、libstdc++.6.tbd
、libstdc++.tbd
也从Xcode10中删除了。app
最好的解决办法仍是尽快转到libc++
开发spa
若是还想要继续在Xcode10上编译依赖libstdc++
的项目或库,能够经过把Xcode9中的libstdc++
相关库文件复制到Xcode10中便可。
在Xcode9中搜索libstdc++
相关的库,能够找到四个相关的文件:3d
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++.6.0.9.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libstdc++.6.0.9.tbd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.6.0.9.tbd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.6.0.9.tbd
可是只找到了
codelibstdc++.6.0.9.dylib
和libstdc++.6.0.9.tbd
,找不到libstdc++.6.dylib
、libstdc++.dylib
、libstdc++.6.tbd
、libstdc++.tbd
,前往找到的这4个路径中会就会发现libstdc++.6.dylib
、libstdc++.dylib
是libstdc++.6.0.9.dylib
的替身,libstdc++.6.tbd
、libstdc++.tbd
是libstdc++.6.0.9.tbd
的替身:
因此我尝试将libstdc++.6.0.9.dylib
和libstdc++.6.0.9.tbd
复制到Xcode10中,并制做libstdc++.6.dylib
、libstdc++.dylib
、libstdc++.6.tbd
、libstdc++.tbd
这四个替身文件,可是在模拟器上运行崩溃,本身制做替身的方案不可行,而后我改成了制做副本的方式成功在模拟器上运行。orm
libstdc++.6.0.9.dylib
和libstdc++.6.0.9.tbd
以及制做好的副本libstdc++.6.dylib
、libstdc++.dylib
、libstdc++.6.tbd
、libstdc++.tb
blog