【问题标题】:Getting cmath errors after updating to Mojave更新到 Mojave 后出现 cmath 错误
【发布时间】:2019-04-03 11:47:53
【问题描述】:

我昨天更新到 Mojave,从那时起就无法编译 c++ 文件。我收到以下消息:

In file included from test.cpp:4:
In file included from /usr/local/include/bits/stdc++.h:10:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^

完整的消息在这里pastebin

文件 test.cpp 只是打印 Hello world,我正在使用命令“make test”来运行它。

注意:我确实知道网上关于类似问题的线程,但我无法理解它们,并认为它们过于针对 OP。

【问题讨论】:

  • 能否将您的 test.cpp 的最小版本添加到您的问题中?
  • 编辑时无法添加代码,代码如下:pastebin.com/UEA8Axtn
  • #include <bits/stdc++> 不是标准 C++。你甚至从哪里得到标题?它不是我的 Mojave 安装的一部分。
  • 其实我已经试过了(垃圾箱里还有xcode应用但是我无法删除),有没有其他方法可以彻底删除?
  • 我有个朋友帮我修好了,问题出在我机器上的一些 g++ 编译器别名。

标签: c++ xcode


【解决方案1】:

我遇到了这个问题,并在过去几周内对其进行了相当多的研究。我找到了一个与 cmets 中提到的不同的临时解决方案。

删除/移除 XCode。

不幸的是,这不是一个很好的解决方案,因为它是我的 C++ IDE。但是我目前似乎无法以任何其他方式解决它。

这里也提到了解决方案:https://github.com/PointCloudLibrary/pcl/issues/2601

【讨论】:

    猜你喜欢
    • 2019-04-13
    • 1970-01-01
    • 1970-01-01
    • 2010-11-29
    • 1970-01-01
    • 1970-01-01
    • 2018-05-19
    • 2023-03-14
    • 1970-01-01
    相关资源
    最近更新 更多