问题描述
我刚刚发现的<文件stdlib.h>
和< stdio.h中>
头是位于 / usr / include目录
文件夹中的Ubuntu的服务器,但我没有找到 SYS / types.h中
。
I just found out that the <stdlib.h>
and <stdio.h>
headers are located in the /usr/include
folder in Ubuntu server, but I don't find sys/types.h
.
和我开始怀疑编译器实际上不会使用头文件中的 / usr / include目录
文件夹中。
And I start to suspect the compiler won't actually use the header file in the /usr/include
folder.
这是真实的,其中该文件在什么位置?
Is this true, and where is the file located?
推荐答案
我的Debian框(希望Ubuntu的没有宰杀它的在他们的热情太的多)有它在 /usr/include/sys/types.h
。
My Debian box (and hopefully Ubuntu haven't butchered it too much in their zeal) has it in /usr/include/sys/types.h
.
您最好的选择就是先执行:
Your best bet is to first execute:
find /usr/include -name types.h
然后
find / -name types.h
如果你没有找到它的第一个。
if you don't find it in the first one.
但是,请记住,发展东西,甚至可能不是的安装。的我就成像服务器框,就是要用作服务器,它不会让我感到吃惊,如果编译器和一堆其他的东西是不是默认安装的一部分(但它有很多的服务器之类的东西的ftpd
或的Apache
等)。
However, keep in mind that the development stuff may not even be installed. I would imaging a server box is meant to be used as a server and it wouldn't surprise me if the compiler and a bunch of other stuff was not part of the default install (but it would have a lot of server things like ftpd
or Apache
and so on).
如果编译器的地方中找到它,你只是不知道在哪里,你可以使用类似:
If the compiler is locating it somewhere and you just don't know where, you can use something like:
echo "#include <sys/types.h>" | gcc -E -x c - | grep /types.h
要找出它从得到它。
或者
echo "#include <stdio.h>" | gcc -E -x c - | grep /stdio.h
对于其他头你担心。
for the other header you're worried about.
旁白:那 GCC
命令行pre-处理阶段后停止( -E
),强制文件被视为C源$ C $ C( -xc
),并从标准输入(检索程序 -
),在这种情况下,从回声
语句。
最后的grep
只是剔除了不重要的行。
The final grep
just strips out the unimportant lines.
这篇关于其中SYS / types.h中位于何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!