我用clang编译以下.c文件
#include <linux/bpf.h>
#define SEC(NAME) __attribute__((section(NAME), used))
static long (*bpf_trace_printk)(const char *fmt, __u32 fmt_size, ...) = (void *) 6;
SEC("example")
int example_entry(struct xdp_md *ctx)
{
char msg[] = "Hello, BPF World!";
bpf_trace_printk(msg, sizeof(msg));
return 0;
}
char _license[] SEC("license") = "GPL";
报错
In file included from /usr/include/linux/bpf.h:11:
/usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
请问如何解决?网上千篇一律的答案,没有一个解决了问题。
你看一下有没有这个库文件啊
解决了吗?