/os_intfs.c:1641:5: error: implicit declaration of function ‘wiphy_net’ [-Werror=implicit-function-declaration] dev_net_set(ndev, wiphy_net(adapter_to_wiphy(adapter)));
时间: 2024-01-24 09:04:14 浏览: 76
这是一个编译错误,提示该文件中的第1641行出现了一个隐式声明的函数"wiphy_net",导致编译失败。这意味着在该文件中没有包含"wiphy.h"头文件或者相关的库文件。你需要确认代码中是否包含了正确的头文件和库文件,并且代码中是否正确引用了这些文件。如果确认无误之后,可以尝试修改编译选项,添加相关的库文件或者头文件路径。
相关问题
linux内核报错:drivers/pmeminfo/process_mem.c:157:2: error: implicit declaration of function 'seq_printf' [-Werror,-Wimplicit-function-declaration] seq_printf(m, "%u\n", top_n); ^ drivers/pmeminfo/process_mem.c:175:9: error: implicit declaration of function 'single_open' [-Werror,-Wimplicit-function-declaration] return single_open(file, process_mem_show, NULL); ^ drivers/pmeminfo/process_mem.c:175:9: note: did you mean 'simple_open'? ./include/linux/fs.h:3243:12: note: 'simple_open' declared here extern int simple_open(struct inode *inode, struct file *file); ^ drivers/pmeminfo/process_mem.c:182:11: error: use of undeclared identifier 'seq_read' .read = seq_read, ^ drivers/pmeminfo/process_mem.c:183:13: error: use of undeclared identifier 'seq_lseek' .llseek = seq_lseek, ^ drivers/pmeminfo/process_mem.c:184:13: error: use of undeclared identifier 'single_release' .release = single_release, ^
这些错误是由于缺少头文件或者没有正确包含所需的头文件。`seq_printf`,`single_open`,`seq_read`,`seq_lseek`和`single_release`都是序列文件的函数。因此,您需要包含`<linux/seq_file.h>`头文件来解决这些错误。例如,在您的`.c`文件中添加以下行:
```
#include <linux/seq_file.h>
```
如果还有其他依赖关系,则需要添加相应的头文件。另外,请确保您的Makefile中正确包含了所有需要的源文件和头文件。
make[2]: Entering directory '/home/test/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libdrm-2.4.36/libkms' CC linux.lo linux.c: In function 'linux_name_from_sysfs': linux.c:76:2: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration] maj = major(buffer.st_rdev); ^ linux.c:76:2: warning: nested extern declaration of 'major' [-Wnested-externs] linux.c:77:2: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration] min = minor(buffer.st_rdev); ^ linux.c:77:2: warning: nested extern declaration of 'minor' [-Wnested-externs] cc1: some warnings being treated as errors make[2]: *** [Makefile:409: linux.lo] Error 1 make[2]: Leaving directory '/home/test/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libdrm-2.4.36/libkms' make[1]: *** [Makefile:612: all-recursive] Error 1 make[1]: Leaving directory '/home/test/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libdrm-2.4.36' make: *** [Makefile:394: all] Error 2
这个错误是因为在 linux.c 文件中使用了 major 和 minor 函数,但是编译器无法找到它们的声明。可以尝试在文件开头添加如下代码:
```
#include <sys/sysmacros.h>
```
这个头文件包含了 major 和 minor 函数的声明。如果还是无法解决问题,可能需要检查是否有其他头文件缺失或者链接库没有正确链接。
阅读全文