Xcode 10 (iOS 12) does not contain libstdc++6.0.9

后端 未结 14 1858
礼貌的吻别
礼貌的吻别 2020-11-28 21:28

I download the newest Xcode from Apple, but I found I cannot search the library named \"libstdc++6.0.9\".

相关标签:
14条回答
  • 2020-11-28 21:39

    You should remove libstdc++ from other linker flags in your xcode project

    Check this :

    0 讨论(0)
  • 2020-11-28 21:41

    This will work. Do not copy the .dylib files from /usr/lib to simruntime.

    List of files and paths to copy from Xcode 9.4.1 to Xcode 10.2.1

    A) Copy the file: libstdc++.6.0.9.tbd and libstdc++.6.tbd and libstdc++.tbd

    from > Xcode9_41/Xcode9_41.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

    to > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib

    B) Copy the file: libstdc++.6.0.9.dylib and libstdc++.6.dylib and libstdc++.dylib

    from > Xcode9_41/Xcode9_41.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib

    to > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib

    0 讨论(0)
  • 2020-11-28 21:44

    For me -l"stdc++.6" was added during pod install I found it in 'Pods/Target\ Support\ Files/Pods-SomeTarget/Pods-SomeTarget.debug.xcconfig'

    To resolve the issue you can use post_install handler in Podfile:

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            if target.name == "Pods-SomeTarget”
                puts "Updating #{target.name} OTHER_LDFLAGS"
                target.build_configurations.each do |config|
                    xcconfig_path = config.base_configuration_reference.real_path
                    xcconfig = File.read(xcconfig_path)
                    new_xcconfig = xcconfig.gsub('-l"stdc++.6" ', '')
                    File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
                end
            end
        end
    end
    
    0 讨论(0)
  • 2020-11-28 21:45

    libstdc++ is removed in iOS 12.

    I wish I had a better source than an Apple engineer on Twitter, but that's all I have.

    @jeremyhu PSA: libstdc++ is gone from the iOS 12.0 SDK (it is present in the runtime for binary compatibility). It's days are numbered on macOS as well. Migrate over to libc++ if you haven't already. #WWDC2018 #cplusplus

    Edit: Here's a better source, Xcode 10 patch 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 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)

    0 讨论(0)
  • 2020-11-28 21:45

    Because apple removes libstdc++ in Xcode 10.0, so if you want to solve the problem, you can try to manually copy the file to lib.

    1.iPhoneOS and iPhoneSimulator file

    copy the file: libstdc++.6.0.9.tbd and libstdc++.6.tbd and libstdc++.tbd to :

    • /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

    • /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

    2.iOS.simruntime file

    copy the file: libstdc++.6.0.9.dylib and libstdc++.6.dylib and libstdc++.dylib to:

    • /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
    0 讨论(0)
  • 2020-11-28 21:51

    I've faced the same issue after updating to xcode 10. I've resolved this issue by downloading libstdc++.6.0.9.tbd and libstdc++.6.tbd from https://github.com/Kila2/libstdc-.6.0.9.tbd.

    then i copied these files to my project folder. After that I added these libs in Linked Frameworks and Libraries by following these steps: Project > Target > General > Linked Frameworks and Libraries click (+) > Click 'Add Other' > Navigat to your project folder in 'Open File' and select these libraries and add.

    Now run the project it will run perfectly..

    0 讨论(0)
提交回复
热议问题