Xamarin.iOS library not found for -lstdc++.6.0.9

Hi everyone,

After updating to Xcode 10 and Xamarin.iOS 12.0.015, I cannot build my native Xamarin.iOS projects anymore with VS for Mac.
I also updated the Command Line Tools.

I get the following errors:

error MT5209: Error: library not found for -lstdc++.6.0.9
MTOUCH: Error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -ObjC -lc++ -lsqlite3 -lz (MT5201)
MTOUCH: Error MT5202: Native linking failed. Please review the build log. (MT5202) 

Anyone else encountered these errors?

BR // Corneliu

Posts

  • jeremywhojeremywho USMember

    Did you find a solution to this? I'm having a similar problem.

  • CesarMoyaCesarMoya USMember ✭✭

    I am having the same exact issue, have you guys found a solution by any chance?

  • CesarMoyaCesarMoya USMember ✭✭

    @CorneliuSerediuc @jeremywho Since I'm having the same issue I wanted to ask you: are you using telerik components or ibm worklight dll's in your projects by any chance? I'm trying to find a common culprit. Thanks,

  • CorneliuSerediucCorneliuSerediuc USMember ✭✭

    I contacted Microsoft support and they gave me the following solution (which works):

    It seems that the issue is a missing library that is causing the build errors:

    error MT5209 : Native linking error : library not found for -lstdc++.6.0.9

    Could you please confirm that you have downloaded and installed XCode 10 GM from the Apple Store?

    It would also seem that Apple has deprecated -lstdc++ tool and that is why it is not included in iOS12. Please take a look at the comments here:

    https stackoverflow.com/questions/50694822/xcode-10-ios-12-does-not-contain-libstdc6-0-9

    “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++.”

    If the use of lstdc++ is not explicitly used by you, it means one of the packages in your app is using it. In either case, please update the references as above if possible, or copy the file from the previous XCode folders. Just to reiterate, this is a change in XCode and iOS.

  • CesarMoyaCesarMoya USMember ✭✭

    @CorneliuSerediuc I can confirm copying the libraries from XCode 9.4 fixed the issue for me too. Thanks!

  • CorneliuSerediucCorneliuSerediuc USMember ✭✭

    You may copy it from old Xcode(9.4) like this

        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/
    
Sign In or Register to comment.