xcode - Clang 在 OSX 中找不到头文件,系统完整性使我无法移动它们。如何在 Big Sur 中链接它们?
问题描述
在使用 clang 构建一些软件包时,我得到:
fatal error: 'math.h' file not found
#include <math.h>
^~~~~~~~
1 error generated.
我已经安装了命令行工具:
% xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
现在,我发现了另一个帖子,他们发现问题在于头文件位于错误的位置。确实可以math.h
在/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
. 同一篇文章指出系统完整性阻止您将文件移动到/usr/local/include
. 然后一些评论者建议使用:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -usr /
或者
sudo installer -allowUntrusted -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
但是我没有该文件macOS_SDK_headers_for_macOS_10.14.pkg
(或任何类似文件)。那个包裹不再发货还是我错过了什么?有没有一种合法的方法可以将头文件移动到正确的位置而不必关闭系统完整性?
注意我还了解到/usr/local
苹果不再使用它。因此,它们似乎/usr/local/include
是这些文件最合适的目标位置,因为我确定它在路径中(正如运行 clang with 所揭示的那样-v
)。
解决方案
推荐阅读
- google-forms - 将 Google 表单响应从 Excel 值转换为 pdf 图像
- c - #ifdefs, C 中打印值的更改
- sql - 根据列有条件地应用日期过滤器 - Oracle SQL
- python - 为什么我的线性回归分数这么低?
- c# - Unity3D:无法将脚本后端更改为 .NET
- excel - 如何在excel中修剪或移动一列的最后一个字母到另一列。我附上了代码
- video - 如何在给定帧速率、分辨率和每像素颜色编码的情况下计算视频大小?
- c++ - 如何删除代码块中的环境错误
- excel - Excel VBA 副本创建新工作表而不是复制到现有工作表
- java - 字符串压缩到字符 ArrayList