title: unknown symbol __class_create (err 0)
body: <p>This is probably a stupid question, but I looked for hours online and couldn't find an answer...</p>
  
  <p>I'm writing a kernel module that also creates a character device. It compiles with no errors and warnings but when I try <code>sudo insmod my_mod.ko</code> I get:</p>
  
  <p><code>insmod: error inserting 'my_mod.ko': -1 Unknown symbol in module</code></p>
  
  <p>and when I try to look at <code>dmesg</code> I see:</p>
  
  <pre><code>my_mod: Unknown symbol __class_create (err 0)
  my_mod: Unknown symbol device_create_file (err 0)
  my_mod: Unknown symbol device_create (err 0)
  </code></pre>
  
  <p>I'm guessing that I missed an <code>include</code> but I can't find which...</p>
  
  <p>What are the includes needed?</p>
  
  <p>My includes are currently:</p>
  
  <pre><code>#include &lt;linux/module.h&gt;
  #include &lt;linux/kernel.h&gt;
  #include &lt;linux/ip.h&gt;
  #include &lt;linux/netfilter.h&gt;
  #include &lt;linux/netfilter_ipv4.h&gt;
  #include &lt;linux/cdev.h&gt;
  #include &lt;linux/fs.h&gt;
  </code></pre>