Reputation: 696
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
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:
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
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