title: Unknown symbol when compiling kernel module from multiple files
body: <p>I am writing a kernel module that is comprised of several source files,
  One of these source files has a function that needs to be used by the other objects in the same module.</p>
  
  <p>It is defined in my file named ModemAPI.c</p>
  
  <pre><code>static void LogMessage ( char *format, ...)
  </code></pre>
  
  <p>This c file should be (together with other files) compiled into one kernel module, its makefile looks like this:</p>
  
  <pre><code>obj-m += ModemAPI.o
  
  ModemAPI-objs := ../Common/StateMachine.o ../Common/ElementsPool.o 
  </code></pre>
  
  <p>When I compile this kernel module, I get a warning during linking that the above function "LogMessage" is undefined and when I try to load the module I get an error saying it has an unknown symbol in it (of course LogMessage).</p>
  
  <p>EDIT: Just to make clear, the function "LogMessage" is declared and implemented in the file ModemAPI.c, moreover it is exported via EXPORT_SYMBOL</p>
  
  <pre><code>EXPORT_SYMBOL(LogMessage);
  </code></pre>
  
  <p>In the files that use the function (such as StateMachine.c), it is declared via extern</p>
  
  <pre><code>extern void LogMessage ( char *format, ...);
  </code></pre>
  
  <p>The module compiles, the problem is in the linking stage.</p>
  
  <p>Does anyone have any idea what could be the problem with this?</p>
  
  <p>Thanks,
  Roy.</p>