找不到bits / mathcalls.h

时间:2014-02-12 15:40:12

标签: c makefile

您好我尝试创建C可执行文件,我似乎无法找到“bits / mathcalls.h”。

$ make

45) cannot find include file "bits/mathcalls.h"
        not in /usr/include/linux/bits/mathcalls.h
        not in include/bits/mathcalls.h
        not in /usr/include/bits/mathcalls.h

但是使用find

$ sudo find / -name 'mathcalls.h'
/usr/include/mathcalls.h
/usr/include/i386-linux-gnu/bits/mathcalls.h 

所以它确实存在,但不是在“make”正在查找的任何位置。如何添加这些路径以便“make”在实际拥有它们的地方查找它们?

非常感谢

1 个答案:

答案 0 :(得分:2)

您不应该直接包含bits/mathcalls.h。您应始终只包含math.h,然后它将为您的目标操作系统/体系结构包含正确的mathcalls.h。事实上,如果你打开并阅读你拥有的任何mathcalls.h标题,他们将在他们的前几行中出现类似

的内容。
#ifndef _MATH_H
# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
#endif

如果您实际尝试在没有math.h的情况下包含它们,那将会引发错误。

相关问题