title: linker woes - undefined reference
body: <p>I'm having a problem with my compiler telling me there is an 'undefined reference to' a function I want to use in a library. Let me share some info on the problem:</p>
  
  <ul>
  <li>I'm cross compiling with gcc for C.</li>
  <li>I am calling a library function which is accessed through an included header which includes another header, which contains the prototype.</li>
  <li>I have included the headers directory using -I and i'm sure it's being found.</li>
  <li>I'm first creating the .o files then linking them in a separate command.</li>
  </ul>
  
  <p>So my thought is it might be the order in which I include the library files, but i'm not sure what is the correct way to order them. I tried with including the headers folder both before and after the .o file.</p>
  
  <p>Some suggests would be great, and maybe and explanation of how the linker does its thing.</p>
  
  <p>Thanks!</p>
  
  <hr>
  
  <p>Response to answers</p>
  
  <ul>
  <li>there is no .a library file, just .h and .c in the library, so -l isn't appropriate</li>
  <li>my understanding of a library file is that it is just a collection of header and source files, but maybe it's a collection of .o files created from the source?!</li>
  <li>there is no library object file being created, maybe there should be?? Yes seems I don't understand the difference between includes and libraries...i'll work on that :-)</li>
  </ul>
  
  <p>Thanks for all the responses! I learned a lot about libraries. I'd like to put all the responses as the accepted answer :-)</p>