I download the newest Xcode from Apple, but I found I cannot search the library named "libstdc++6.0.9".

- 37,241
- 25
- 195
- 267

- 584
- 1
- 5
- 8
-
2try with `libc++` instead of `libstdc++` – Anbu.Karthik Jun 05 '18 at 07:51
-
You need to add it dont you? similar question from last year... https://stackoverflow.com/questions/36057291/libstdc-6-0-0-tbd-or-dylib – Scriptable Jun 05 '18 at 07:51
-
3Adding `libc++` does not work for me, `libstc++` is also unavailable – sgdesmet Jun 05 '18 at 10:28
14 Answers
libstdc++ was deprecated 5 years ago. Apple's more recent platforms (tvOS and watchOS) don't support it.
Support was removed from the iOS 12.0 Simulator runtime, but it remains in the iOS 12.0 (device) runtime for binary compatibility with shipping apps.
You should update your project to use libc++ rather than libstdc++ by setting the CLANG_CXX_LIBRARY build setting ("C++ Standard Library") to libc++.
If you have any static libraries that depend on libstdc++.tbd, you can workaround it for now by copying the file from the SDKs in Xcode 9.4 (and libstdc++.*.dylib in the iOS simulator runtime), but that is not a long term solution. You should contact the provider of those libraries and request versions built using libc++.

- 22,938
- 5
- 78
- 86
You may copy it from old Xcode(9.4). It should work.
cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
-
If it's Apple wish to remove support for the lib, then this solution may not work for iTunes Connect or future iOS versions. – Cœur Jun 06 '18 at 09:11
-
@Cœur that's true, but this is an ok temporary solution if you need to build your existing project. – NKorotkov Jun 08 '18 at 10:08
-
Run on simulator: dyld: Library not loaded: /usr/lib/libstdc++.6.dylib Referenced from: /Users/root/Library/Developer/CoreSimulator/Devices/3D8BF0EC-E838-451D-A39D-E5723E0CD938/data/Containers/Bundle/Application/7168BA72-4111-44CB-92A3-20C5F5BF585B/VPDemo.app/VPDemo Reason: no suitable image found. Did find: /usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator – zhengwu119 Jun 11 '18 at 02:48
-
-
This doesn't work completely for me, app can't be run on simulator. I know support was removed for iOS12, but maybe it can be manually added to make it operable... – silentBob Aug 10 '18 at 12:29
-
I had the same issue with a Xamarin Visual Studio project and this solution worked for me as well. I also tried downloading the libraries from another reply on this same thread (someone uploaded them to github) but those were giving me some strange errors about being "too small for ARM architecture". so if you have this issue skip the trouble and just download xcode from apple and copy from there. – cesar-moya Oct 09 '18 at 20:00
libstdc++
is removed in iOS 12.
I wish I had a better source than an Apple engineer on Twitter, but that's all I have.
@jeremyhu PSA: libstdc++ is gone from the iOS 12.0 SDK (it is present in the runtime for binary compatibility). It's days are numbered on macOS as well. Migrate over to libc++ if you haven't already. #WWDC2018 #cplusplus
Edit: Here's a better source, Xcode 10 patch notes
Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must now migrate to libc++ and are recommended to set a deployment target of iOS 7 or later. Besides changing the C++ Standard Library build setting, developers should audit hard-coded linker flags and target dependencies to remove references to libstdc++ (including -lstdc++, -lstdc++.6.0.9, libstdc++.6.0.9.tbd, and libstdc++.6.0.9.dylib). Project dependencies such as static archives that were built against libstdc++ will also need to be rebuilt against libc++. (40885260)

- 1
- 1

- 6,422
- 7
- 44
- 92
Xcode 10 cancels the libstdc++ library with built-in the lib so we should copy the file to the lib by hand.
copy the file: (libstdc++.6.0.9.tbd) and (libstdc++.6.tbd) to :
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
and
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
(Please note the distinction "iPhoneOS" and "iPhoneSimulator")
clean xcode and rebuild it.
Here is the file.

- 358
- 4
- 12
-
2I downloaded the libraries from the github location provided on this reply but I was getting an error about the libraries "being too small for ARM architecture", so I downloaded XCode 9.4 from apple developer portal directly, uncompressed it and manually copied the libraries and that worked perfect. Thanks! – cesar-moya Oct 09 '18 at 19:59
-
-
In some cases, you also need to copy ```dylib``` files. They should be located to ```Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/``` – khcpietro Mar 26 '19 at 09:17
Taken from Xcode 10 Beta 2 release notes and applicable to all future versions of Xcode:
Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must now migrate to libc++ and are recommended to set a deployment target of iOS 7 or later. Besides changing the C++ Standard Library build setting, developers should audit hard-coded linker flags and target dependencies to remove references to libstdc++ (including -lstdc++, -lstdc++.6.0.9, libstdc++.6.0.9.tbd, and libstdc++.6.0.9.dylib). Project dependencies such as static archives that were built against libstdc++ will also need to be rebuilt against libc++. (40885260)
Apple will unlikely ever support libstdc++ again.

- 37,241
- 25
- 195
- 267
-
2This answer helped me fix my build. I scrubbed for "libstdc++" bu searching for it in the Search or Filter bar at top of the project and target windows in Xcode. I found my reference to it in the Target's Build Phases tab under "Link Binary With Libraries". I deleted libstdc++6.0.tbd by pressing the minus button in the list. – aaronsti Aug 24 '18 at 21:25
I've faced the same issue after updating to xcode 10. I've resolved this issue by downloading libstdc++.6.0.9.tbd and libstdc++.6.tbd from https://github.com/Kila2/libstdc-.6.0.9.tbd.
then i copied these files to my project folder. After that I added these libs in Linked Frameworks and Libraries by following these steps: Project > Target > General > Linked Frameworks and Libraries click (+) > Click 'Add Other' > Navigat to your project folder in 'Open File' and select these libraries and add.
Now run the project it will run perfectly..

- 361
- 3
- 14
Because apple removes libstdc++ in Xcode 10.0, so if you want to solve the problem, you can try to manually copy the file to lib.
1.iPhoneOS
and iPhoneSimulator
file
copy the file: libstdc++.6.0.9.tbd
and libstdc++.6.tbd
and libstdc++.tbd
to :
/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/
2.iOS.simruntime
file
copy the file: libstdc++.6.0.9.dylib
and libstdc++.6.dylib
and libstdc++.dylib
to:
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib

- 69
- 1
- 2
-
1For Simulator issues with`/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator`, can try copy the original file: `libstdc++.6.0.9.dylib` and `libstdc++.6.dylib` and `libstdc++.dylib` to: `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib` – RamboLu Oct 12 '18 at 01:15
-
-
+1. With Xcode 10 you might only do the first step but with Xcode 11 and iOS 13 simulator, you urgently need second step. – Luat Vu Dinh Apr 10 '20 at 02:59
For me -l"stdc++.6" was added during pod install
I found it in 'Pods/Target\ Support\ Files/Pods-SomeTarget/Pods-SomeTarget.debug.xcconfig'
To resolve the issue you can use post_install handler in Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "Pods-SomeTarget”
puts "Updating #{target.name} OTHER_LDFLAGS"
target.build_configurations.each do |config|
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
new_xcconfig = xcconfig.gsub('-l"stdc++.6" ', '')
File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
end
end
end
end

- 219
- 4
- 9
Jeremy Huddleston Sequoia's answer gave me the direction to resolve this issue. So before going ahead, make sure you have read his answer.
Even after updating the C++ library in your project, you might face a linking error where Xcode is not able to link your project with this libstdc++ lib.
The solution is - if your project structure has libstdc++ included, it might have turned red because Xcode couldn't find the reference for it. If you remove that entry from the project structure and add the new lib instead(libc++), you're good to go.

- 549
- 7
- 10
Copy it from old Xcode(9.4) will work for physical iOS devices.
For Simulator issues with Did find: /usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator
. Looks like apple removed compatibility support for simulator. Just download iOS 11.4 simulator and it can be run on it.

- 31
- 2
For simulator, just remove libstdc++.6.0.9.tbd from the Linked Frameworks and Libraries.

- 14,570
- 9
- 53
- 75
I was able to fix the build issue by copying the necessary files from 9.4 to 10.1, both platform libs and runtime. But it only resolves the cases with simulator. My app still stucks at start (splash screen) when running on physical device.

- 33
- 7
This will work. Do not copy the .dylib files from /usr/lib to simruntime.
List of files and paths to copy from Xcode 9.4.1 to Xcode 10.2.1
A) Copy the file: libstdc++.6.0.9.tbd and libstdc++.6.tbd and libstdc++.tbd
from > Xcode9_41/Xcode9_41.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
to > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
B) Copy the file: libstdc++.6.0.9.dylib and libstdc++.6.dylib and libstdc++.dylib
from > Xcode9_41/Xcode9_41.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
to > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib

- 834
- 9
- 23