Reputation: 1542
I'm using an eclipse project that somebody else set up. My past experience has been with Makefile-based projects imported into Eclipse CDT. This one is using the CDT internal builder.
The problem I'm having is that due to unrelated version control issues, I made some temporary copies of source files, just to make sure the sources I've changed don't get clobbered. These copies are getting sucked into the CDT build and of course causing multiple definition errors. Is this standard behavior for the internal builder? How can I avoid having the builder pick up files that I don't want to be compiled?
Illustration: I changed foo.cpp and bar.cpp. I made copies of these files: "foo - Copy.cpp" and bar - Copy.cpp" in the same original folder. The eclipse builder tries to build foo.cpp, bar.cpp, "foo - Copy.cpp", and "bar - Copy.cpp". I did not add the "copy" files to the project.
Upvotes: 1
Views: 57
Reputation: 33932
When Eclipse finds a c or cpp file in a C or C++ project folder, it assumes you want the file built and linked in. You can tell Eclipse otherwise by right clicking the file and selecting Resource Configurations->Exclude from Build from the pop-up menu. Put a check mark in the configurations, sounds like all of them in this case, you wish the file to be left out of and then click OK.
Upvotes: 3