Search code examples
clinuxnetwork-programminglinux-kernelheader-files

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

Solution

  • try this find / -name skbuff.h 2>/dev/null then when it finds the location use the -I/path/to/folder when you compile your program.. If it doesn't find the header you don't have it!