As noted in the title, I've gone to Big Sur and Xcode 13, and now when I try to build a project that worked in Xcode 12, it fails with the error "File not found: /usr/lib/libstdc++.6.dylib for architecture x86_64" in the linker phase.
After doing some reading, this appears to be a result of Apple dropping support for GCC in favor of LLVM, only problem is that I've selected "Compiler Default" for C and C++ language dialects, as well as explicitly setting C++ Standard Library to libc++, so I don't know why it's trying to link against libstdc++ (I looked at the Build Phases, and there's nothing in there related to libstdc++ that I can see.) About the only thing that I can think of is other binary code in the project, which is a separate application and two dynamic libraries -- I rebuilt the application and one of the libraries (I don't have the ability to rebuild the other library, as it is from a third party,) making sure that there was nothing associated with GCC, and I'm still getting the same error.
Of course, I have cleaned the project, quit and restarted Xcode, rebooted, etc, and the problem persists. Short of starting a new project and rebuilding the existing one in a "clean" setting, I have no idea what to do about getting this project working again. I was able to move another Objective-C project to the new computer and it builds just fine.
Any insights into what to look at in my project settings would be appreciated. Alternatively, I could copy libstdc++.6.0.9.dylib into /usr/lib/ (I have a copy from a previous installation,) but I've spent the day trying to figure out how to do that, without success -- csrutil disable and csrutil authenticated-root disable and logging in as root accomplished nothing. It's ridiculous that they've made it impossible for me to intentionally add a file to a computer that I own and physically possess, but I guess that's the way it is.
Thanks!
For the other binary file that you can't recompile, use the otool -L
command in Terminal to determine what it links. Separate from that, use the search filed above the build settings view to look for any settings that reference to libstdc++
. The settings you already looked at are one way to set this library requirement, but it can be set in other ways too, such as various "Other Flags" build settings.