Where is sys/types.h located?
来源:互联网 发布:netcat端口转发 编辑:程序博客网 时间:2024/06/05 09:30
http://stackoverflow.com/questions/11823063/where-is-sys-types-h-located
Where is sys/types.h located?
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
.
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?
4 Answers
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
then:
find / -name types.h
if you don't find it in the first one.
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
to find out where it's getting it from.
Or:
echo "#include <stdio.h>" | gcc -E -x c - | grep /stdio.h
for the other header you're worried about.
Aside: That
gcc
command line stops after the pre-processing phase (-E
), forces the file to be treated as C source code (-x c
) and retrieves the program from standard input (-
), in this case from theecho
statement.
The final grep
just strips out the unimportant lines.
gcc
way works, now I found the file – mko Aug 6 '12 at 6:13/usr/include/linux/types.h
. – jmervine May 30 '13 at 0:55The file sys/types.h
is located at the /usr/include/sys/types.h
if u get this kind of Fatal Error:
.../linux/linux_types.h:146:38: fatal error: /usr/include/sys/types.h: Nosuch file or directory
Fix by using the following code:
sudo apt-get install build-essential flex libelf-dev libc6-dev-amd64 binutils-dev libdwarf-dev
On Linux, types.h
should be in /usr/include/sys/types.h
.
If you have locate command available you can simply use locate
:
-bash-3.2$ locate sys/types.h/usr/include/sys/types.h/usr/lib/syslinux/com32/include/sys/types.h-bash-3.2$
It's the quickest and simplest way to do it.
- Where is sys/types.h located?
- sys/types.h
- sys/types.h
- sys/types.h
- sys/types.h
- linux : sys/types.h
- sys/types.h
- <sys/types.h>
- #include<sys/types.h>
- sys/types.h
- sys/types.h的作用
- 派生类型(sys/types.h)
- <sys/types.h>的作用
- NHibernate - Where ISession.Query<T>() is located
- 头文件sys/types.h <sys/stat.h>
- 头文件sys/types.h <sys/stat.h>
- 头文件sys/types.h <sys/stat.h>内容解释
- #include <sys/types.h>的作用
- Struts2中的相对路径与绝对路径
- 设计模式六大原则----------总结
- c语言练习 7-1. 换个格式输出整数
- 05-mysql的基本使用
- (续)AE中读取所打开shp的属性表
- Where is sys/types.h located?
- 渗透测试中的冷却启动攻击和其他取证技术
- 一些数据库端口记录和各种各样的端口
- Tokyo Tyrant(TTServer)系列(一)-介绍和安装
- 06-MYSQL数据类型 日期 字符串
- 剑指offer 面试题5 从尾到头打印链表(栈实现)
- switch语句
- java如果模拟请求重启路由器(网络爬虫常用),还有java如何下载图片
- AcEd库概述
echo "#include <sys/types.h>" | gcc -E -x c - | grep types
to see where it is picking it up from– Mat Aug 6 '12 at 5:49-
used for? – mko Aug 6 '12 at 5:55