简体   繁体   中英

exporting/ installing Kernel header in ubuntu

when i try to install kernel header in ubuntu it is installed in /usr/src/linux-header-2.6.xy

many place in the web (including below) says it should be installed in /usr/include/linux/*

http://www.mjmwired.net/kernel/Documentation/make/headers_install.txt

why there is a discrepancy in the ubuntu kernel header install?

also if i want to use these header do i need to use -I switch in gcc?

Some of the reference also state that files under /usr/include/linux should contain symlink to /usr/src/linux-header-2.6.xy which does not seems to be the case here...

The headers in /usr/include/linux are the headers of the kernel which glibc and other system libraries depend on. See to which package they belong:

$ dpkg -S /usr/include/linux/if.h 
linux-libc-dev: /usr/include/linux/if.h

Some of glibc sys/ headers depend on the linux/ headers, and these are usually the same headers (or close to the ones) glibc's binary was compiled against.

Therefore, building a custom kernel should not replace those by default, otherwise it can create binary incompatibility.

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