【问题标题】:Clang++ Environment Error in MacMac 中的 Clang++ 环境错误
【发布时间】:2018-04-09 16:57:03
【问题描述】:

我使用 mac 和 clang 作为我的默认编译器。某天有人不小心删除了我的一个库,导致我的环境崩溃了……现在我执行clang++的时候,我的终端上出现了很多错误信息,说:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:101:9: error:

          no member named 'div_t' in the global namespace
    using ::div_t;
          ~~^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:102:9: error:
          no member named 'ldiv_t' in the global namespace
    using ::ldiv_t;
          ~~^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:104:9: error:
          no member named 'lldiv_t' in the global namespace
    using ::lldiv_t;
          ~~^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:106:9: error:
          no member named 'atof' in the global namespace
    using ::atof;
          ~~^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:107:9: error:
          no member named 'atoi' in the global namespace
    using ::atoi;
          ~~^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:108:9: error:
          no member named 'atol' in the global namespace
    using ::atol;
          ~~^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/`c++/v1/cstdlib:110:9: error:
          no member named 'atoll' in the global namespace
    using ::atoll;

它总共有 50 个错误! 我想问的是,有没有办法在不重装系统的情况下恢复clang环境?我只是不知道这些函数到底在哪里......

【问题讨论】:

    标签: c++ macos clang environment clang++


    【解决方案1】:

    尝试从 Applications 文件夹中删除 Xcode.app,清空回收站,然后从 App Store 重新安装。

    【讨论】:

    • 我已经做到了,但仍然无法恢复......真是令人沮丧。也许我的依赖错过了......
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-09
    • 1970-01-01
    • 2011-09-18
    • 2016-02-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多