vmlinux.h conflicts with bpf.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I get errors when compiling my bpf application, because vmlinux.h seems to conflict with bpf.h. 
If I include <bpf/bpf.h> or <bpf/libbpf.h>, I get tons of errors like

>    In file included from .output/bpf/libbpf.h:18:                                                                                                                 
>    ../libbpf/include/uapi/linux/bpf.h:54:2: error: redefinition of enumerator 'BPF_REG_0'                                                                        
>            BPF_REG_0 = 0,                                                                                                                                         
>            ^                                                                                                                                                      
>    ../vmlinux/vmlinux.h:31938:2: note: previous definition is here                                                                                                
>            BPF_REG_0 = 0,                                                                                                                                         
>            ^                                   



What I'm trying to do is use the function `bpf_map_get_next_key` to find an entry in a hash table, and that function is defined in bpf.h. 
I also tried using the `bpf_map__get_next_key` function from libbpf.h instead, but libbpf.h includes bpf.h so I get the conflicts anyway.

I generated vmlinux.h using the `gen_vm_linux_h.sh` script from libbpf-bootstrap/tools, and my Makefile is also the one from the bootstrap example.



I feel like I am missing something but I can't figure it out (I am quite new to bpf) even by looking in this mailing list archive.
If you have any idea of what's wrong, please let me know.



Best regards,

Théophile



[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]


  Powered by Linux