zoukankan      html  css  js  c++  java
  • Xcode10 library not found for -lstdc++ 找不到问题

    在Xcode9上正常编译的项目,在Xcode10上编译可能会遇到如下错误:

    library not found for -lstdc++.6.0.9
    library not found for -lstdc++.6
    library not found for -lstdc++

    这是因为Xcode10彻底废弃了libstdc++,相关的库文件libstdc++.6.0.9.dyliblibstdc++.6.dyliblibstdc++.dyliblibstdc++.6.0.9.tbdlibstdc++.6.tbdlibstdc++.tbd也从Xcode10中删除了。

    最好的解决办法还是尽快转到libc++开发

    如果还想要继续在Xcode10上编译依赖libstdc++的项目或库,可以通过把Xcode9中的libstdc++相关库文件复制到Xcode10中即可。
    在Xcode9中搜索libstdc++相关的库,可以找到四个相关的文件:

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++.6.0.9.dylib
    
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libstdc++.6.0.9.tbd
    
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.6.0.9.tbd
    
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.6.0.9.tbd
    

      

    但是只找到了libstdc++.6.0.9.dyliblibstdc++.6.0.9.tbd ,找不到libstdc++.6.dyliblibstdc++.dyliblibstdc++.6.tbdlibstdc++.tbd,前往找到的这4个路径中会就会发现libstdc++.6.dyliblibstdc++.dyliblibstdc++.6.0.9.dylib的替身,libstdc++.6.tbdlibstdc++.tbdlibstdc++.6.0.9.tbd 的替身:

     
    libstdc++.6.0.9.dylib
     
    libstdc++.6.0.9.tbd

    所以我尝试将libstdc++.6.0.9.dyliblibstdc++.6.0.9.tbd 复制到Xcode10中,并制作libstdc++.6.dyliblibstdc++.dyliblibstdc++.6.tbdlibstdc++.tbd这四个替身文件,但是在模拟器上运行崩溃,自己制作替身的方案不可行,然后我改为了制作副本的方式成功在模拟器上运行。

    libstdc++.6.0.9.dyliblibstdc++.6.0.9.tbd以及制作好的副本libstdc++.6.dyliblibstdc++.dyliblibstdc++.6.tbdlibstdc++.tbd下载地址点这里

    真机运行库
    在终端输入以下命令打开Xcode的lib库目录(此目录位安装的默认目录)

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

    如果安装在其他目录 或者Xcode改名的建议右键Xcode显示报内容,进入

    Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib

    获取到的 真机的 libstdc++.6.0.9.tbd 文件,扔进去或按照上方链接运行sh脚本

     
  • 相关阅读:
    【POJ2893&HDOJ6620】M × N Puzzle(n*m数码判定)
    idea破解方法
    ORACLE:MERGE INTO
    DOS命令大全
    使用oracle 的 PL/Sql 定时执行一个存储过程
    spring RestTemplate用法详解
    Oracle截取字符串和查找字符串
    PLSQL Developer常用设置及快捷键
    IntelliJ IDEA设置自动导入包
    Git使用详细教程
  • 原文地址:https://www.cnblogs.com/lidarui/p/10040195.html
Copyright © 2011-2022 走看看