View Full Version : Missing asm/io.h when compiling?

October 9th, 2009, 07:11 PM

I am trying to compile some test programs from the "Linux Device Drivers" book. The problem is that I get the error error: asm/io.h: No such file or directory when compiling.
I have downloaded the kernel source 2.6.28 from the ubuntu repo so it is not a vanilla kernel. I know that the include dir when compiling is
/the/path/to/kernel/source/2.6.28/include in that dir there is a symbolic link asm which is pointing to asm-x86 dir. Inside that dir there is one file
asm-offsets.h. After some searching I found that /the/path/to/kernel/source/2.6.28/arch/x86/include also has a asm dir but with a lot more h-files so I changed the symbolic link to that dir instead and the error was fixed but I got another missing file error this time config.h. What is the correct way to handle this error where should the missing io.h file be located?

Thanks for your help

October 10th, 2009, 05:52 AM
hi, to recursively look for whatever file the easiest way is generally,

$find </some/path/> -name <some_filename>

although obviously you'll need to look for the right header file your code requires!

If your using a ubuntu kernel to build against I'd recommend using a linux-headers-2.6.28 package instead of the source though