- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
这个头文件应该定义NULL
或size_t
等宏,但是我发现/usr/include/linux/stddef.h
是空的?为什么?
最佳答案
header 的实际位置是实现定义的。你看的不是典型的<stddef.h>
包含在 gcc 中。您可以通过以下方式准确找到它在系统中的位置:
gcc -E - <<<'#include<stddef.h>' | grep stddef.h
相当于包含标题 <stddef.h>
在一个空的 C 文件中运行 gcc -E
在上面。
/usr/include/linux
中的 header 用于编译 C 库(通常是 Linux 上的 glibc)。 GNU manual说:
The linux, asm and asm-generic directories are required to compile programs using the GNU C Library; the other directories describe interfaces to the kernel but are not required if not compiling programs using those interfaces. You do not need to copy kernel headers if you did not specify an alternate kernel header source using ‘--with-headers’.
而 C 库头文件通常放在 /usr/lib/
中的某处.在我的 ubuntu 15.04 上, header /usr/include/linux/stddef.h
是空的。但是在我的 CentOS 上,它有:
#ifndef _LINUX_STDDEF_H
#define _LINUX_STDDEF_H
#undef NULL
#if defined(__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
底线是,这不是 stddef.h
您对标准头文件的位置感兴趣,并且一般来说,您不应该对标准头文件的位置做出任何假设。
关于c - 为什么/usr/include/linux/stddef.h 是空的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31285258/
我正在使用源代码中的Postgres 13(Rel_13_STRATE分支),并且我使用的是来自apachea/age源代码的(Release/PG13/1.3.0分支)中的1.3.0版的Apache
/usr/bin/ld: cannot find -ldlib /usr/bin/ld: cannot find -lcblas /usr/bin/ld: cannot find -llapack 在
我正在尝试运行 project 。但它给出了一个错误 fs.js:666 return binding.readdir(pathModule._makeLong(path));
我的新 CentOS7 中有两个目录: Work_Folder1/my_project/linux_dev.cfg Work_Folder2/my_project/linux_dev.cfg 如果我尝
我正在读这个thread和 PostgreSQL 9.4 的手册。我跑 ps auxw | grep postgres | grep -- -D 但是得到 postgres 17340 0.0
我想在我的 shell 中使用系统服务,但该服务的 bin 路径在不同的机器上是不同的(/usr/sbin/myservice 或/usr/local/sbin/myservice)。 那么,我怎样才
我正在为 centos 制定 RPM 规范,如果 arch 是 64 位的,它需要将共享库安装到/usr/lib64,否则需要安装到/usr/lib? 最佳答案 这不是它应该的工作方式。决定库去向的不
我使用 gem install watchr 在 OS X (10.8.3) 上安装了 watchr。它安装在 /usr/bin/watchr $ which watchr /usr/bin/watc
在linux下我们经常用到的四个应用程序的目录是:/bin、/sbin、/usr/bin、/usr/sbin bin: bin为binary的简写主要放置一些系统的必备执行档例如:cat、cp
我在 Pop_OS 下使用 PyCharm 2020.2.3 和 Python 3.8.6! 20.10(你可以像我使用 Ubuntu 20.10 一样)无法在 /usr/bin 或 /usr/lib
我在新的 MacBook 中使用 OS X Yosemite。刚刚安装了 Homebrew 和一些基本的软件包,最近搬到了这台新电脑上。 我注意到,当我安装新的 brew 包时,偶尔会出现链接错误。出
我到 gcc 的链接行连续包含以下两个条目: -lrt -lpam 这似乎扩展为: /usr/lib64/librt.so /usr/lib/libpam.so 为什么 rt 解析为 lib64 而
我有一个大型捆绑软件发行版的错误 Makefile。在某些时候,编译器总是“忘记”我想在 32 位程序中编译。这导致部分程序具有 64 位库,而其他程序具有 32 位库。 如何在每次运行 gcc 时强
如果我安装了Go发行版软件包,则会在/usr/lib/golang/pkg中看到很多文件,在/usr/lib/golang/src中看到非常相似的文件集。这两组之间有什么关系? pkg是从src中的源
我在安装 python 2.7.6 时犯了一个错误,没有使用 home brew,现在我的 python 设置为 /usr/local/bin/python 中的 python(这是 2.7.6)。
我是一名见习程序员,有时我的头脑浮在云端.. 我的同事通过 ssh 连接来搞乱我的专业计算机。其中一位告诉我,防止这种情况发生的最佳方法是保护我的计算机。为了做到这一点,我不小心更改了/usr 目录的
我在 ubuntu 16.04 上尝试编译 fbthrift ( https://github.com/facebook/fbthrift ) 时遇到奇怪的错误 make[4]: Entering d
我遇到了这个奇怪的问题 ag: /usr/lib64/liblzma.so.5: no version information available (required by ag) 由于某种原因,预装
我用的是 ubuntu。 我发现安装的许多 Python 库都在 /usr/lib/python 和 /usr/lib64/python 中。 当我打印一个模块对象时,模块路径显示该模块位于/usr/
在 Linux 上,特别是 Debian Jessie,我应该使用 /usr/bin/python 还是应该在 /usr/local/bin 中安装另一个副本? 据我所知,前者是系统版本,随着操作系统
我是一名优秀的程序员,十分优秀!