title: How to fix error: implicit declaration of function ‘setup_timer’
body: <p>Trying to compile linux core module for usb-audio card Line6 UX2.
  Got code from repo and trying to make. Repo have no ./configure</p>
  
  <p>Make produce error:</p>
  
  <pre class="lang-sh prettyprint-override"><code>line6linux-code-r1108/driver/trunk/driver.c:169:2: error: implicit declaration of function ‘setup_timer’; did you mean ‘del_timer’? [-Werror=implicit-function-declaration]
    setup_timer(timer, function, data);
    ^~~~~~~~~~~
    del_timer
  </code></pre>
  
  <p>C function setup_timer() declare in the linux linux-headers package. Currently is linux-headers-4.18.0-16
  Of course it's installed in the default place /usr/src/</p>
  
  <p>Code wich produce error (driver.c):</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;linux/kernel.h&gt;
  #include &lt;linux/module.h&gt;
  #include &lt;linux/timer.h&gt;
  #include &lt;linux/export.h&gt;
  #include &lt;linux/slab.h&gt;
  #include &lt;linux/usb.h&gt;
  
  #include &lt;sound/core.h&gt;
  #include &lt;sound/initval.h&gt;
  
  #include "capture.h"
  #include "driver.h"
  #include "midi.h"
  #include "playback.h"
  
  ... some code here
  
  /*
      Setup and start timer.
  */
  void line6_start_timer(struct timer_list *timer, unsigned long msecs,
                 void (*function)(unsigned long), unsigned long data)
  {
      setup_timer(timer, function, data); // &lt;-- string 169
      mod_timer(timer, jiffies + msecs_to_jiffies(msecs));
  }
  EXPORT_SYMBOL_GPL(line6_start_timer);
  </code></pre>
  
  <p>So apparently compiler can't find linux headers. How can I fix it?</p>
  
  <p>Also based on the INSTALL file, it follows that the driver was written for the kernel version linux-headers-2.6.x and now it's 4.18.0-16.</p>
  
  <p>And more from INSTALL: For other distributions, please consult the documentation to find out which package you have to install.</p>
  
  <p>Everything is lost?</p>
  
  <p>OS Ubuntu 18.10
  Linux 4.18.0-16-generic #17-Ubuntu SMP Fri Feb 8 00:06:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux</p>