编译 BPF 程式时发生 asm/types.h' file not found

$ clang -O2 -target bpf -c bpf_program.c -o bpf_program.o                                                         2023-10-26 23:11:30In file included from main.c:1: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.

解决方法:

apt-get install -y gcc-multilib

这样就可以了

参考资料

https://www.ghl.name/archives/how-to-fix-asm-types-h-no-found.html

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章