title: error compiling: linux/module.h: No such file or directory
body: <p>I've written a simple module:</p>
  
  <pre><code>#define __KERNEL__
  #define MODULE
  #include &lt;linux/kernel.h&gt; 
  #include &lt;linux/module.h&gt;
  
  int init_module(void)
  {
      printk("Hello, world\n");
      return 0;
  }
  
  void cleanup_module(void)
  {
      printk("Goodbye\n");
  }
  </code></pre>
  
  <p>and compiling it with this command:</p>
  
  <pre><code>cc -c hello.c
  </code></pre>
  
  <p>but I'm getting this error:</p>
  
  <pre><code> linux/module.h: No such file or directory
  </code></pre>
  
  <p>any suggestions?</p>
  
  <p>EDIT: 
  I used this commad:</p>
  
  <pre><code>cc -I/usr/src/linux-headers-3.0.0-17-generic/include -c hello.c
  </code></pre>
  
  <p>and it goes one step ahead, now I get this error:</p>
  
  <pre><code>In file included from /usr/src/linux-headers-3.0.0-17-generic/include/linux/kernel.h:13:0,
                   from hello.c:3:
  /usr/src/linux-headers-3.0.0-17-generic/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
  compilation terminated.
  </code></pre>