Search code examples
iosxcodemacosxcode10

ld: library not found for -lstdc++.6


After updating Xcode Version to 10.0 beta start getting "ld: library not found for -lstdc++.6" error. same code working fine in Xcode 9.2

Also updated macOS to 10.13.5


Solution

  • The quick solution is to copy all libstdc++.* file from old Xcode(9.4) to new Xcode(10.x)

    For device :

    cp /Applications/Xcode9.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.* /Applications/Xcode10.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

    For Simulator :

    cp /Applications/Xcode9.4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.* /Applications/Xcode10.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/