clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated] ld: library not found for -lstdc++ clang: error: linker command failed with exit code 1 (use -v to see invocation)

i am working on old project written in objective-c and stucked with this issue

*************************

clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated]

ld: library not found for -lstdc++

clang: error: linker command failed with exit code 1 (use -v to see invocation)

*************************


using mac os mojave (10.14.1) xcode (10.1)

tried many solutions but failed


but same project is working fine with using mac os 10.13.5 Xcode Version 9.3 (9E145)

Accepted Reply

libstdc++ has been deprecated on Apple platforms for several years, noted in the Xcode release notes. Here is the relevant information about the removal of support from the Xcode 10 Release 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 macOS 10.9 or later, or 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++.

Replies

libstdc++ has been deprecated on Apple platforms for several years, noted in the Xcode release notes. Here is the relevant information about the removal of support from the Xcode 10 Release 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 macOS 10.9 or later, or 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++.

Is there currently, or in the future, going to be restrictions on submitting apps to the app store that have a dependency on libstdc++?

Xcode 10 will be required to submit apps very soon, so you won't be able to build any apps that use libstdc++.

Hi Edford,


Thanks for the response. To expand on my scenario, my app doesn't build against libstdc++ directly, one of our dependencies for which we have pre-build binaries has a dependency on libstdc++. We are currently able to build in Xcode 10, the only negative impact of the dependency on libstdc++ is that we cannot run on simulators with iOS 12.0.


Given that expanded scenario would we be blocked from submitting our app to the app store?


Thanks,

TaA80

I am unable to answer whether any given scenario is allowed on the App Store or not. You can contact App Review through the developer website.