title: Eclipse-CDT/C++: Undefined reference-errors although right .o-files are created and passed to the linker
body: <p>At first: I am <em>not</em> using an already compiled library.</p>
  
  <p>Here's the situation: I've got a C++ project in eclipse CDT that has a folder structure like this:</p>
  
  <pre><code>project
    somefoldername
      src
      include
    library
      src
      include
  </code></pre>
  
  <p>somefoldername/src and library/src are defined as source folders and somefoldername/include as well as library/include are defined as include folders (under C/C++ General->Paths and Symbols, which also affects the compilers -I option).</p>
  
  <p>The "library" folder contains the source code of a library used by my own code (which can be found in "somefolder"). Well, compiling of the whole project works fine, but linking crashes with a whole bunch of "undefined reference" errors in the library's source.</p>
  
  <p>The undefined reference errors occur, although *.o-files are created in which the missing functions should be found - and also are passed to the linker afterwards.</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Edit:</strong> Updated to current configuration and the attempts to solve the problem.</p>
  
  <p><strong>Edit2:</strong> The accepted answer helped me out a bit, but the biggest problem seemed to be the "linking everything at once"-policy followed by eclipse. I went to <a href="http://en.wikipedia.org/wiki/Autoconf" rel="nofollow">autoconf</a> and built the library first, before linking it to the main application. Although it's more work, it's a cleaner approach.</p>