Upgraded to Xcode 13 and Big Sur and now I can't build my project

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!

Answered by DTS Engineer in 689773022

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.

Accepted Answer

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.

If I can ask your help again, I was able to get an updated library and replaced the older version with the new by deleting the older and adding the new one. This has caused another problem:

`dyld: Library not loaded: @executable_path/../libtbarcode11.0.dylib

  Referenced from: /Forms Viewer/Build/Products/Debug/Forms Viewer.app/Contents/MacOS/Forms Viewer

  Reason: image not found`

When I look at the two different builds (the one that works with libtbarcode10.0.dylib, and the one that doesn't work with libtbarcode11.0.dylib, I can see the problem:

Old version: @executable_path/../Frameworks/libtbarcode10.0.dylib (compatibility version 1.0.0, current version 1.0.0)

New version: @executable_path/../libtbarcode11.0.dylib (compatibility version 1.0.0, current version 1.0.0)

What's missing from the new version is "Frameworks" in the path, because that's where the library is being placed (and it's where the old version placed the library,) but I don't know what I have to do to correct it. In the "Runpath Search Paths" setting, I have "@loader_path/../Frameworks" and "@executable_path/../Frameworks" in both the old version and the new.

Any direction would be appreciated!

Try to run: install_name_tool -change @executable_path/../libtbarcode11.0.dylib @executable_path/../Frameworks/libtbarcode10.0.dylib <PathToTheNewLibrary.dylib>

Hope it helps.

Brigitte

Upgraded to Xcode 13 and Big Sur and now I can't build my project
 
 
Q