Very simple application fails with "multiple target patterns" from Eclipse

Solution 1:

Are you working from a Cygwin installation?

I've seen this problem before using Cygwin--basically, make sees the : in the path and thinks it is another target definition, hence the error.

If you are working from a Cygwin installation, you might try replacing the c:/ with /cygdrive/c/. If not, you might try using relative paths or using a network mount and see if that fixes it.

Solution 2:

according to other internet sources this is related to a problem that cygwin make has with windows path names, specially the c:. For me it workes fine with setting relative paths instead.

e.g. if you have something like

proj/mymodule/headers/afile.h
proj/mymodule/source/abc/afile.c

just add ../mymodule/headers/ as include path in the project configuration for the compiler this will find the header afile.h and will generate make files with relative path. (compiler command will have the statement -I../mymodule/headers/ )

looks like execution directory is always the project base directory.

Solution 3:

On Cygwin, GNU make version 3.81-1 delivered by the default setup program doesn't work with the automatic header file dependencies, generated by the compilers. The error message you will see because of this bug will look something like this:

Here are two suggested fixes: - Try to obtain the previous version (3.80) - Obtain a fixed 3.81 version, for example from http://www.cmake.org/files/cygwin/make.exe

src: https://projects.coin-or.org/BuildTools/wiki/current-issues

Simply replace the make file in your "C:\cygwin\bin\" folder (or wherever cygwin is installed) with the "fixed" make file mentioned above.

Solution 4:

Looks like there is a simple way to solve this. Just change the "Current Builder" from "GNU Make Builder" to "CDT Internal Builder" in Project properties->C/C++ Builder->Tool Chain Editor->Current Builder will do.

To me, this problem is caused by the automatically generated "XXX.d" dependency files in Debug directory (or release :), which were generated by gcc -MF as a side-effect to gcc -c. But GNU make obviously forgot to add quotations around file names when -MF.

"CDT Internal Builder" does not use makefile nor GNU make at all. Eclipse manage the build process itself.

If you insist to use GNU make, this doesn't work