ld: library not found for -lstdc++.6.0.9
clang: error: linker command failed with exit code 1 (use -v to see invocation)
原因:Xcode10中已去除这个stdc++.6.0.9这个库。报这个错一般是项目中有用到stdc++.6.0.9
解决方法:在Podfile中增加post_install的hook,将stdc++.6.0.9替换成c++。
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
#TargetName为自己项目的Target名
if target.name == 'Pods-TargetName'
target.build_configurations.each do |config|
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
new_xcconfig = xcconfig.sub('stdc++.6.0.9', 'c++')
File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
end
end
end
end



