更新到莫哈韦后出现cmath错误

Getting cmath errors after updating to Mojave

本文关键字:cmath 错误 哈韦 更新      更新时间:2023-10-16

我昨天更新到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,我正在使用命令"maketest"来运行它

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

我遇到过这个问题,在过去的几周里对它进行了大量研究。我找到了一个与评论中提到的不同的临时解决方案。

删除/删除XCode

不幸的是,对我来说,这不是一个好的解决方案,因为它是我的C++IDE。然而,我目前似乎无法用任何其他方式解决这个问题。

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