floppsb
floppsb

Reputation: 696

Make: *** multiple target patterns. Stop

I'm currently working on an introductory C++ project, using Eclipse Juno, with CDT and Cygwin C++. I'm using an MVC architecture and have just gotten the code to a point where I can run the executable and see some results. When I build the application, the compiler doesn't throw any errors; however, when I run the application through Eclipse, the application rebuilds and displays the following error:

make: *** multiple target patterns.  Stop.  GasFinderTUI.d KyleGasStationFinder/Debug/src/View  line 1  C/C++ Problem

Here is my code from that file:

src/Controller/GasFinderController.d src/Controller/GasFinderController.o:  \
 ../src/Controller/GasFinderController.cpp \
  ../src/Controller/GasFinderController.h \
  C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/LocalGasStations.h \
  C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/GasStation.h \
  C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/GasPump.h \
  C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/Utilities.h

../src/Controller/GasFinderController.h:

C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/LocalGasStations.h:

C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/GasStation.h:

C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/GasPump.h:

C:/Users/Kyle/Dropbox/Workbench/KyleGasStationFinder/src/Model/Utilities.h:

I've tried cleaning and rebuilding, without using the run function, and the application builds cleanly. I've also run the actual .exe file without Eclipse, and the application runs as expected. Although running the application separately from Eclipse is an acceptable substitute, I'll be writing several applications in C++ in the near future and would appreciate the ability to execute from Eclipse. These applications will also be examined and graded using Eclipse and I'm sure my instructor would also like this convenience.

I've looked at this question which recommends changing the C:/ for either a relative path name, or /cygwin/c/. My other .d files, as well as my include paths, utilize a relative path and those files pose no issue. Although I believe both of these solutions would work, the .d file is recreated for every compilation. All changes that I've made have been overwritten upon every build.

Does Eclipse and/or Cygwin C++ contain any settings that might allow me to prevent this complication from occurring in the future?

Upvotes: 2

Views: 18823

Answers (2)

user4411382
user4411382

Reputation:

You can also remove the 'multiple target patterns' error when using the external 'Gnu Make' builder. I'm using Eclipse Kepler with CDT 8.3.0, and did the following:

  1. In Include path for all build configs, i.e. at Project Properties | C/C++ Build | Settings | Cygwin C [or C++] Compiler | Includes,
  2. Put 2 versions of each required include path, the Cygwin style followed by the Windows style, e.g.
    /cygdrive/d/cygwin64/usr/share/whatever/include
    D:/cygwin64/usr/share/whatever/include
  3. This causes the dependency files (*.d) in each build config's source directory to use the Cygwin-style paths in the dependencies, which removes the above error, as it is the colon ':' characters in these files which causes it, as @andrewdotn said.
  4. This also allows CDT to find the include files in the C/C++ source files, as it generally finds them when searching the Windows-style include path (Note: I'm using Cygwin as my build toolchain, rather than MinGW).

I realise the above is specific to a particular toolchain setting, but at least it gives a possible alternative way of getting the managed Make projects working properly.

This is my first post on StackOverflow, by the way, so if I make any etiquette mistakes, they're unintentional :)

Upvotes: 1

floppsb
floppsb

Reputation: 696

I've figured out that I can run the project inside Eclipse, only if I manually clean it before each run. Also, the builds are successful if I manually clean it before each build. I will look into creating a custom script for compilation after I submit this assignment.

Upvotes: 3

Related Questions