gpt4 book ai didi

linux - 如何在 linux 中找到包含 MAJOR 定义的头文件?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:06:10 24 4
gpt4 key购买 nike

当我在linux下编译一个c代码文件时,出现了以下问题:

  1. 对“MINOR”的 undefined reference
  2. 对“主要”的 undefined reference

我想随着时间的推移,有些头文件没有被包含或者有些头文件已经改变了。但是我不确定哪个头文件改变了或者没有被包含。我使用 grep 命令找到一些包含 MAJOR 宏定义的头文件但是没有帮助。Linux 版本:

  • 经销商 ID:Ubuntu
  • 描述:Ubuntu 15.10
  • 发布:15.10
  • 代号:wily

.c 文件包含以下头文件:

 <stdio.h>  /* fprintf */
<string.h>
<stdlib.h> /* contains exit */
<sys/types.h> /* unistd.h needs this */
<sys/stat.h>
<linux/fs.h>
<unistd.h> /* contains read/write */
<fcntl.h>

我搜索了谷歌但什么也没找到。任何建议都是有帮助的。

最佳答案

linux/types.h 中定义的 dev_t 类型

和在 linux/kdev_t.h 中找到的宏

可以引用 Major and Minor Numbers

关于linux - 如何在 linux 中找到包含 MAJOR 定义的头文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46295674/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com