How to avoid compilation errors like "error: no member named xxx in strut xxx"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: How to avoid compilation errors like "error: no member named xxx in strut xxx"?
- From: Shuyi Cheng <chengshuyi@xxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Jun 2021 12:06:18 +0800
- Cc: kafai@xxxxxx, andrii@xxxxxxxxxx, songliubraving@xxxxxx, yhs@xxxxxx
- User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0
I am trying to write a bpf program that supports multiple linux kernel
versions. However, there are some differences in the definition of
struct net in these multiple kernel versions.
Therefore, when we include a certain kernel version of vmlinux.h, the
compilation error "error: no member named'proc_inum' in strut net" will
appear.
However, when we include another kernel version of vmlinux.h, the
compilation will appear "error: no member named'ns.inum' in strut net".
Anakryiko mentioned in the issue of libbpf/libbpf-bootstrap: vmlinux.h
is just a convenient way to have most of kernel types defined for you,
so that you don't have to re-define them manually. Link here: https:
//github.com/libbpf/libbpf-bootstrap/issues/31#issuecomment-861035643
But struct net is a very huge structure, and it may be very difficult to
add it manually. So, how can we avoid compilation errors like "error: no
member named'xxx' in xxx"
[Index of Archives]
[Linux Samsung SoC]
[Linux Rockchip SoC]
[Linux Actions SoC]
[Linux for Synopsys ARC Processors]
[Linux NFS]
[Linux NILFS]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Yosemite News]
[Linux Kernel]
[Linux SCSI]