title: Error: Unknown symbol in module?
body: <p>I wrote a simple Linux kernel module:</p>
  
  <pre><code>#include &lt;linux/kernel.h&gt;
  #include &lt;linux/module.h&gt;
  #include &lt;linux/init.h&gt;
  #include &lt;linux/reboot.h&gt;
  
  static int my_init(void)
  {
      machine_power_off();
      return  0;
  }
  
  static void my_exit(void)
  {
      return;
  }
  
  module_init(my_init);
  module_exit(my_exit);
  </code></pre>
  
  <p>Source compiled successfully but after installing the module (<code>insmod</code>) the following error occurred:</p>
  
  <pre><code>Error: could not insert module my_module.ko: Unknown symbol in module
  </code></pre>
  
  <p>System log error:</p>
  
  <pre><code>Jun 25 21:50:00 my-virtual-machine kernel: [31625.207827] my_module: Unknown symbol machine_power_off (err 0)
  </code></pre>
  
  <p>How do I solve this error?</p>
  
  <p>machine_power_off:</p>
  
  <p><a href="http://lxr.free-electrons.com/ident?i=machine_power_off" rel="nofollow">http://lxr.free-electrons.com/ident?i=machine_power_off</a></p>