Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How to create a project with multiple sub projects
How to create a project with multiple sub projects [message #217510] Wed, 18 June 2008 03:25 Go to next message
Eclipse UserFriend
Originally posted by: chenal.naritech.cn

I create a c++ project imported from head first design patterns source
codes, in which there are multiple sub projects, such as Adapter,
Factory, Strategy and etc. In each sub project, there is a .cpp source
file containing the main method. When I compile the project, eclipse
will tell errors that the project has multiple main methods. I do not
want to create individual projects for each design pattern. So how to
work out the problem?

Allen
Re: How to create a project with multiple sub projects [message #217515 is a reply to message #217510] Wed, 18 June 2008 03:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chenal.naritech.cn

Allen Chen 写道:

I am sorry the sub project(s) should be sub folder(s).

> I create a c++ project imported from head first design patterns source
> codes, in which there are multiple sub projects, such as Adapter,
folders
> Factory, Strategy and etc. In each sub project, there is a .cpp source
folder
> file containing the main method. When I compile the project, eclipse
> will tell errors that the project has multiple main methods. I do not
> want to create individual projects for each design pattern. So how to
> work out the problem?
>
> Allen
Re: How to create a project with multiple sub projects [message #217540 is a reply to message #217515] Wed, 18 June 2008 04:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

Eclipse will compile and link all source files that it finds within a
project and sub-folders. If you have multiple main() files that create
individual .exe's then each will need to be in its own project.

Allen Chen wrote:
> Allen Chen 写道:
>
> I am sorry the sub project(s) should be sub folder(s).
>
>> I create a c++ project imported from head first design patterns source
>> codes, in which there are multiple sub projects, such as Adapter,
> folders
>> Factory, Strategy and etc. In each sub project, there is a .cpp source
> folder
>> file containing the main method. When I compile the project, eclipse
>> will tell errors that the project has multiple main methods. I do not
>> want to create individual projects for each design pattern. So how to
>> work out the problem?
>>
>> Allen


--
Derek
Re: How to create a project with multiple sub projects [message #217706 is a reply to message #217540] Mon, 23 June 2008 17:29 Go to previous message
Eclipse UserFriend
Originally posted by: joppekroon.gmail.com

Derek is right,

If you're using the automatic makefile generation from eclipse, you will
have to split it up in several projects. however I would like to add that
it is not to hard to write makefiles that can do what you want, just use
the standard make system.

If you have some time to spare you could write an extension to the Managed
Build System to generate the makefiles yourself. I'm in the process of
writing a plug-in that does exactly that, and It's almost finished. drop
me a line if you're interested.

Greetings,
Joppe Kroon


Derek wrote:

> Eclipse will compile and link all source files that it finds within a
> project and sub-folders. If you have multiple main() files that create
> individual .exe's then each will need to be in its own project.

> Allen Chen wrote:
>> Allen Chen ÐŽµÀ:
>>
>> I am sorry the sub project(s) should be sub folder(s).
>>
>>> I create a c++ project imported from head first design patterns source
>>> codes, in which there are multiple sub projects, such as Adapter,
>> folders
>>> Factory, Strategy and etc. In each sub project, there is a .cpp source
>> folder
>>> file containing the main method. When I compile the project, eclipse
>>> will tell errors that the project has multiple main methods. I do not
>>> want to create individual projects for each design pattern. So how to
>>> work out the problem?
>>>
>>> Allen
Previous Topic:include and library specification
Next Topic:Search fields
Goto Forum:
  


Current Time: Sat Jul 12 22:46:02 EDT 2025

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

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

Back to the top