title: Why can't gcc find my static library?
body: <p>I am trying to link the cspec library into my C project. This is my Makefile located in the tests folder:</p>
  
  <pre><code>all: test
  
  test: sample.o
      gcc -Wall -o test sample.o -L ../lib/cspec -llibcspec.a
  
  sample.o: sample.c
      gcc -Wall -c sample.c -I../lib/cspec
  
  clean:
      rm -rf *o test
  </code></pre>
  
  <p>My directory is:</p>
  
  <pre><code>/
  /src
  /lib
  /lib/cspec
  /tests
  </code></pre>
  
  <p>When I run make I receive the following error:</p>
  
  <pre><code>gcc -Wall -o test sample.o -L ../lib/cspec -llibcspec.a
  /usr/bin/ld: cannot find -llibcspec.a
  </code></pre>
  
  <p>I have made sure that the the libcspec.a file is located in the lib/cspec folder but to be sure I have also tried placing it within the tests folder and removing the -L command, to no avail.</p>