Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Multiple main()s?
Multiple main()s? [message #1267691] Sun, 09 March 2014 11:52 Go to next message
Henry Chan is currently offline Henry ChanFriend
Messages: 19
Registered: October 2009
Junior Member
Hi,

Let's I have the following layouts:
/workspace/project1/src/exec1/main.cpp
/workspace/project1/src/exec2/main.cpp
/workspace/project1/src/util/util.cpp
/workspace/project1/src/util/FileReader.cpp
/workspace/project1/src/comm/a.cpp b.cpp c.cpp

Let's exec1/main.cpp needs util/*.cpp and comm/*.cpp, and exec1/main.cpp needs util/FileReader.cpp only but not the rest.

I know I can create two build configurations and I can exclude those unrelated cpp files 1 by 1 through "Resource Configuration"->"Exclude From Build".

However, if I select a folder, let's say util, and I try to exclude the whole folder for a new build configuration (let's say exec3/main.cpp), then Eclipse CDT will make exec1/main.cpp and exec2/main.cpp to include util/*.cpp because I don't check their build configuration when I exclude for exec3/main.cpp's build configuration.

I wonder whether there is a way that I can specify what to exclude for just one build configuration but not to specify for the rest of build configurations.

Or what are the best practices to deal with this kind of "spaghetti" code sharing across different build configurations in 1 Eclispe project?

Thanks in advance.

[Updated on: Sun, 09 March 2014 11:53]

Report message to a moderator

Re: Multiple main()s? [message #1269547 is a reply to message #1267691] Wed, 12 March 2014 01:12 Go to previous message
Henry Chan is currently offline Henry ChanFriend
Messages: 19
Registered: October 2009
Junior Member
No one has multiple main()'s in 1 project?
Previous Topic:OS X - Eclipse IDE for C/C++ Developers Debugger doesn't work!
Next Topic:Blank Stack Trace
Goto Forum:
  


Current Time: Fri Apr 19 21:35:10 GMT 2024

Powered by FUDForum. Page generated in 0.02837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top