简体   繁体   中英

How to include kernel headers in a program

I am writing a libnetfilter_queue program. I am new to linux kernel programming. I need to include linux/skbuff.h, net/checksum.h and many related kernel headers which are not present in /usr/include/linux. I get following error on compilation

 fatal error: linux/skbuff.h: No such file or directory
 fatal error: net/checksum.h: No such file or directory

试试这个find / -name skbuff.h 2>/dev/null然后当它找到位置时,当你编译你的程序时使用-I/path/to/folder .. 如果它没有找到你没有的头有它!

如果您有定位数据库,请locate linux/skbuff.h

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM