title: kernel module error: implicit declaration of function
body: <p>I'm trying to write 2 simple kernel modules: <code>acumulator.c</code> and <code>client.c</code>.</p>
  
  <p>acumulator.c has 2 function : <code>void acumulate();</code> and <code>int consult();</code> plus the <code>init_module</code> and the <code>cleanup_module</code>. 
  The <code>acumulate</code> function increments the value of variable <code>acumulador</code> by 1 every time it's invoked, and the <code>consult</code> function returns the current value of the variable <code>acumulador</code>.</p>
  
  <p>Those 2 functions are invoked within the module <code>Client.c</code>.</p>
  
  <p><code>Client.c</code> has only the <code>init_module()</code> and the <code>cleanup_module</code>, when the <code>init_module</code> starts, it calls the <code>acumulate</code> function and the <code>consult</code> function which are implemented within <code>acumulator.c</code></p>
  
  <p>When I compile the files: <code>acumulator.c</code> it compiles without error but <code>client.c</code> gives me 2 errors: </p>
  
  <pre><code>Implicit declaration of function acumulate()
  Implicit declaration of function consult()
  </code></pre>
  
  <p>I don't know how I can fix this.</p>
  
  <p>my kernel version is 2.6.38</p>
  
  <p>The code of <code>acumulator.c</code> is:</p>
  
  <pre><code>static int acumulador = 0;
  
  void acumulate() {
     acumulador += 1;
  }
  
  int consult() {
     return acumulador;
  }
  
  int init_module() {
      printk("\loading  module acumulator\n");
      return 0;
  }
  
  void cleanup_module() {
      printk("\unloading  modul acumulator\n");
  }
  </code></pre>
  
  <p>and the code of <code>Client.c</code> is </p>
  
  <pre><code>int init_module() 
  {
      acumulate();
      printk("\loading module client:\Acumulate Value is = %d\n", consult());
      return 0;
  }
  
  void cleanup_module() 
  {
      printk("\unloading modul client\n");
  }
  </code></pre>