title: Very simple application fails with "multiple target patterns" from Eclipse
body: <p>Since I'm more comfortable using Eclipse, I thought I'd try converting my project from Visual Studio. Yesterday I tried a very simple little test. No matter what I try, <code>make</code> fails with "multiple target patterns". (This is similar to <a href="https://stackoverflow.com/questions/2100448/multiple-target-patterns-makefile-error">this unanswered question</a>.)</p>
  
  <p>I have three files:</p>
  
  <p>Application.cpp:</p>
  
  <pre><code>using namespace std;
  
  #include "Window.h"
  
  int main() {
      Window *win = new Window();
      delete &amp;win;
      return 0;
  }
  </code></pre>
  
  <p>Window.h:</p>
  
  <pre><code>#ifndef WINDOW_H_
  #define WINDOW_H_
  
  class Window {
  public:
      Window();
      ~Window();
  };
  
  #endif
  </code></pre>
  
  <p>Window.cpp:</p>
  
  <pre><code>#include &lt;cv.h&gt;
  #include &lt;highgui.h&gt;
  
  #include "Window.h"
  
  const char* WINDOW_NAME = "MyApp";
  
  Window::Window() {
      cvNamedWindow(WINDOW_NAME, CV_WINDOW_AUTOSIZE);
      cvResizeWindow(WINDOW_NAME, 200, 200);
      cvMoveWindow(WINDOW_NAME, 0, 0);
      int key = 0;
      while (true) {
          key = cvWaitKey(0);
          if (key==27 || cvGetWindowHandle(WINDOW_NAME)==0) {
              break;
          }
      }
  }
  Window::~Window() {
      cvDestroyWindow(WINDOW_NAME);
  }
  </code></pre>
  
  <p>I have added the following paths to the compiler include path (<code>-I</code>):</p>
  
  <pre><code>"$(OPENCV)/cv/include"
  "$(OPENCV)/cxcore/include"
  "$(OPENCV)/otherlibs/highgui"
  </code></pre>
  
  <p>I have added the following libraries to the linker (<code>-l</code>):</p>
  
  <pre><code>cv
  cxcore
  highgui
  </code></pre>
  
  <p>And the following library search path (<code>-L</code>):</p>
  
  <pre><code>"$(OPENCV)/lib/"
  </code></pre>
  
  <p>Eclipse, the compiler and the linker all succeed in including the headers and libraries. I am using the GNU C/C++ compiler &amp; linker from Cygwin.</p>
  
  <p>When compiling, I get the following <code>make</code> error:</p>
  
  <p><strong><code>src/Window.d:1: *** multiple target patterns.  Stop.</code></strong></p>
  
  <p>Window.d contains:</p>
  
  <pre><code>src/Window.d src/Window.o: ../src/Window.cpp \
    C:/Program\ Files/OpenCV/cv/include/cv.h \
    C:/Program\ Files/OpenCV/cxcore/include/cxcore.h \
    C:/Program\ Files/OpenCV/cxcore/include/cxtypes.h \
    C:/Program\ Files/OpenCV/cxcore/include/cxerror.h \
    C:/Program\ Files/OpenCV/cxcore/include/cvver.h \
    C:/Program\ Files/OpenCV/cxcore/include/cxcore.hpp \
    C:/Program\ Files/OpenCV/cv/include/cvtypes.h \
    C:/Program\ Files/OpenCV/cv/include/cv.hpp \
    C:/Program\ Files/OpenCV/cv/include/cvcompat.h \
    C:/Program\ Files/OpenCV/otherlibs/highgui/highgui.h \
    C:/Program\ Files/OpenCV/cxcore/include/cxcore.h ../src/Constants.h \
    ../src/Window.h
  C:/Program\ Files/OpenCV/cv/include/cv.h:
  C:/Program\ Files/OpenCV/cxcore/include/cxcore.h:
  C:/Program\ Files/OpenCV/cxcore/include/cxtypes.h:
  C:/Program\ Files/OpenCV/cxcore/include/cxerror.h:
  C:/Program\ Files/OpenCV/cxcore/include/cvver.h:
  C:/Program\ Files/OpenCV/cxcore/include/cxcore.hpp:
  C:/Program\ Files/OpenCV/cv/include/cvtypes.h:
  C:/Program\ Files/OpenCV/cv/include/cv.hpp:
  C:/Program\ Files/OpenCV/cv/include/cvcompat.h:
  C:/Program\ Files/OpenCV/otherlibs/highgui/highgui.h:
  C:/Program\ Files/OpenCV/cxcore/include/cxcore.h:
  ../src/Window.h:
  </code></pre>
  
  <p>I tried removing all OpenCV headers from Window.d (from line 2 onwards), but the error remains. Also, I've updated Eclipse and OpenCV, all to no avail.</p>
  
  <p>Do you have any ideas worth trying? I'm willing to try anything!</p>