【发布时间】:2014-09-13 21:32:27
【问题描述】:
我正在尝试使用 gcc 在 OSX 上从头开始编写 C 标准库。当我尝试在我的测试程序中包含我的库中的头文件时,我收到它未定义的错误。我尝试使用 -nostdlib 标志,但仍然无法包含我的文件。
我的测试程序:
#include <math.h>
#include <bool.h>
#include <ctype.h>
#include <string.h>
#include <io.h>
int main(){
int x = sin(0.5);
int y = pow(2,3);
int z = abs(12);
myiofunction(7);
exit(0);
}
math.h、bool.h、ctype.h、string.h 和 io.h 在我的库中定义。我做错了什么?
编辑: 我收到的错误消息是:
helloTest.c:10:10: fatal error: 'bool.h' file not found
【问题讨论】:
-
你得到的确切错误是什么?
-
@nneonneo 我将其添加到问题中。
-
...您是否使用
-I指定了正确的包含路径? -
@nneonneo 我在编译库时所做的
-
是的,但是您在编译程序时这样做吗?
标签: c++ c static-libraries standard-library