This article is a mirror article of machine translation, please click here to jump to the original article.

View: 202|Reply: 0

[C] gcc compiles the first ebpf program

[Copy link]
Posted on 2025-10-24 17:06:36 | | |
This post was last edited by Summer on 2025-10-24 17:11
# First compilation: Reproduce bpf/bpf.h missing error gcc hello.c -o hello
# Error (leave as is):
# hello.c:18:10: fatal error: bpf/bpf.h: No such file or directory
#    18 | #include <bpf/bpf.h>#       |          ^~~~~~~~~~~
# compilation terminated.
# After installing libbpf-dev, compile the second time: reproduce bcc/libbpf.h missing error sudo apt install -y libbpf-dev  
# Install the first dependency gcc hello.c -o hello -lbpf -lbcc# error (leave it as is):
# hello.c:19:10: fatal error: bcc/libbpf.h: No such file or directory
#    19 | #include <bcc/libbpf.h>#       |          ^~~~~~~~~~~~~~# compilation terminated.
sudo apt update && sudo apt install -y libbpfcc-dev













Previous:vscode configuration plugin bito artificial intelligence
Next:ndk is compiled with ndk-build C executable program in win10 using vscode
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com