title: ld.exe: cannot find -lgtest only when using GNU make for windows
body: <p>I have been trying to compile a simple C++ program with the googletest libraries. I have gotten this to work using g++, however the project will soon become large and I want to be able to automate the compilation using make. I installed <a href="http://gnuwin32.sourceforge.net/packages/make.htm" rel="nofollow">GNU make for windows</a> which I have tested on another program and <strong>it works</strong>. However when I try and use make to compile my googletest project I get the following error: </p>
  
  <pre><code>ld.exe: cannot find -lgtest
  </code></pre>
  
  <p>Here is the contents of my makefile:</p>
  
  <pre><code>all: test.exe
      test.exe: main.cpp
      g++ -o test.exe .\main.cpp .\sample1.h .\sample1.cc .\sample1_unittest.cc -ID:\...\gtest\include -LD:\D...\gtest\lib\ -lgtest_main -lgtest -Wall
  clean:
      rm test.o test.exe
  </code></pre>
  
  <p>The weird thing is that if I run the same code from the command line, as follows, <strong>it works</strong> perfectly an I end up with my test.exe. </p>
  
  <pre><code>g++ -o test.exe .\main.cpp .\sample1.h .\sample1.cc .\sample1_unittest.cc -ID:\...\gtest\include -LD:\D...\gtest\lib\ -lgtest_main -lgtest -Wall
  </code></pre>
  
  <p>Does anyone know what this could be caused by and how to fix it?</p>