c++ - 更新到 Mojave 后出现 cmath 错误
问题描述
我昨天更新到 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。
解决方案
我遇到了这个问题,并且在过去的几周里研究了很多。我找到了一个与评论中提到的不同的临时解决方案。
删除/移除 XCode。
不幸的是,对我来说这不是一个很好的解决方案,因为它是我的 C++ IDE。但是我目前似乎无法以任何其他方式解决它。
此处还提到了解决方案:https ://github.com/PointCloudLibrary/pcl/issues/2601
推荐阅读
- azure - Microsoft Groups Graph API Multi-Geo:有没有办法使用应用程序权限(AAD 应用程序)在指定的地理位置创建组
- android - 如果我有图像的内容 uri,如何传递图像文件?
- android - 停止应用程序时发送广播从未执行
- excel - 使用 PowerShell/Curl 下载时 Excel 文件损坏
- postgresql - 找不到驱动程序(Laravel 的 PDO 异常)
- javascript - 为滑动切换调用不同的 onChange 方法
- java - ObjectMapper 不映射对象的内部对象值
- python - 如何使用python在一个excel单元格中写一个列表
- javascript - JavaScript 字符串用多个分隔符拆分,同时保留分隔符
- jquery - 加载屏幕后,如何让我的移动网站上的 selectnav 立即加载?