From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) Description of problem: Compile fail in an example kernel module. From Alessandro Rubini's "Device Driver". #define MODULE #include <linux/module.h> int init_module(void) { printk("<1>Hello, world\n"); return 0; } void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); } Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.write hello.c 2.send 'gcc -c hello.c' 3. Actual Results: In file included from hello.c:3: /usr/include/linux/module.h:60: parse error before 'atomic_t' /usr/include/linux/module.h:60: warning: no semicolon at end of struct or union ..... more error messages Additional info: from module.h: ...... definitions struct module { ... union { atomic_t usecount; long pad; } uc; ....
/usr/include/linux/* and /usr/include/asm/* headers are solely for userland usage, for building kernel modules you need -I/lib/modules/`uname -r`/build/include
Thanks for your fast response, but the problem is the same with this path.
Do you have kernel-source RPM installed (for the kernel you're running)?
Yes, the source installation is very standard.