Getting error : ld: library not found for -lstdc++


#1

Recently I have updated forge platform_version to 2.7.6 . Also I have updated all the modules to the latest version. But when I am trying to package then getting following error :

ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
Ld /var/folders/yk/1m64_9kd7g9bd8f08nnm63sh0000b3/T/tmpz3JspF/ios/app/build/ForgeInspector.build/Release-iphonesimulator/ForgeInspector.build/Objects-normal/x86_64/Forge normal x86_64
Ld /var/folders/yk/1m64_9kd7g9bd8f08nnm63sh0000b3/T/tmpz3JspF/ios/app/build/ForgeInspector.build/Release-iphonesimulator/ForgeInspector.build/Objects-normal/i386/Forge normal i386
(2 failures)

[ INFO] 2019-05-16 11:35:55,224 – cleaning up source directories
[ ERROR] 2019-05-16 11:35:55,225 – Xcode error

Please suggest the workaround for this.


#2

libstdc++ has been deprecated for some time and Apple finally removed it with the release of Xcode 10.

If you need a C++ standard library you’ll have to switch to libc++:

Deprecations

  • 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++. (40885260)

From: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes?language=objc