title: Which header file do I have to include to get printk() within a kernel source file?
body: <p>Let's say I want to use <code>printk()</code> within <code>arch/x86/boot/string.c</code> before compiling the kernel. Which header file do I have to include so that the linker knows where to find <code>printk()</code>? I tried <code>#include &lt;linux/kernel.h&gt;</code> and <code>#include &lt;linux/printk.h&gt;</code> but I always get errors during <code>make bzImage</code> telling me the linker does not find <code>printk</code>:</p>
  
  <pre><code>arch/x86/boot/compressed/string.o: In function `memcmp`:
  string.c:(.text+0x19): undefined reference to `printk`
  </code></pre>