Eclipse CDT: How to manage multiple main () functions in a single C ++ project?

I am starting to develop a project that will consist of several modules. I will check each of these modules using a special test bench, each with its own main () function.
I would like to avoid creating one Eclipse project for each test object and its main () function.

I read about Working Sets , and the idea of ​​showing only files related to a specific test node in my project is what I am looking for.

However, during the build phase, Eclipse continues to create all the project files, not just the current working set files. Then I get a Linker error due to several main () functions.

How to configure Eclipse to create only working set files?
Is there another way to create several programs separately in one project, that is, the application and its testbenches components?

+4
source share
1 answer

In Eclipse CDT, you can use several basic functions by writing a custom makefile . This is a potential solution for C / C ++ projects concerning, for example, the main application and its testbenches components.

, make Eclipse.
(. makefile ), ( ) ( ) .
: make , .

+5

All Articles