Managed C project with several main() functions [message #157087] |
Mon, 31 October 2005 16:33 |
Eclipse User |
|
|
|
Originally posted by: fbarsoba.verizon.net
Hi all,
I'd like to have several files with their correspondent main() functions
under the same project. When I try to do it, I get the error 'multiple
definition of main'. Could anyone tell me what paramtere do I have to
change or how do I have to create the managed project?
thanks,
FBM
|
|
|
Re: Managed C project with several main() functions [message #157129 is a reply to message #157087] |
Mon, 31 October 2005 19:18 |
Henning Riedel Messages: 310 Registered: July 2009 |
Senior Member |
|
|
What does give the error? The CDT or the compiler/linker.
I gues its the linker, which is normal if you compile multiple main's
into one executable!
Try if you can exclude one or the other file from the build process.
Right now, the interface for the following is a little awkward.
Create in the Project Settings multiple Build Configurations for each of
the files with main(), e.g. Debug1, Debug2,..., Release1, Release2,...
You can copy the settings for the new configurations from a given one,
e.g. Debug.
Select a build configuration, then exclude the file containing main()'s
you don't want to use by clicking on the specific file and say
Properties. There go to C/C++ Build settings tab, select the build
configuration and mark the checkbox "Exclude from Build".
This is all for "Managed Make"-Projects, in standard make projects,
adapt your Makefile accordingly.
Fernando Barsoba schrieb:
> Hi all,
>
> I'd like to have several files with their correspondent main() functions
> under the same project. When I try to do it, I get the error 'multiple
> definition of main'. Could anyone tell me what paramtere do I have to
> change or how do I have to create the managed project?
>
> thanks,
>
> FBM
|
|
|
Re: Managed C project with several main() functions [message #157137 is a reply to message #157129] |
Mon, 31 October 2005 19:29 |
Eclipse User |
|
|
|
Originally posted by: fbarsoba.verizon.net
kesselhaus wrote:
> What does give the error? The CDT or the compiler/linker.
> I gues its the linker, which is normal if you compile multiple main's
> into one executable!
>
> Try if you can exclude one or the other file from the build process.
>
> Right now, the interface for the following is a little awkward.
> Create in the Project Settings multiple Build Configurations for each of
> the files with main(), e.g. Debug1, Debug2,..., Release1, Release2,...
>
> You can copy the settings for the new configurations from a given one,
> e.g. Debug.
>
> Select a build configuration, then exclude the file containing main()'s
> you don't want to use by clicking on the specific file and say
> Properties. There go to C/C++ Build settings tab, select the build
> configuration and mark the checkbox "Exclude from Build".
>
> This is all for "Managed Make"-Projects, in standard make projects,
> adapt your Makefile accordingly.
Thanks a lot. I've done it as you said.. and it works nicely..
FBM
|
|
|
Powered by
FUDForum. Page generated in 0.03280 seconds