Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Newbie question, my 2nd program. Is a new project for a new program?(getting started)
Newbie question, my 2nd program. Is a new project for a new program? [message #1288081] Tue, 08 April 2014 09:02 Go to next message
John McLean is currently offline John McLeanFriend
Messages: 1
Registered: April 2014
Junior Member
I'm pretty much a beginner to c++ and an absolute beginner with eclipse. I have a c++ textbook and i'm trying to work through the example bits of code.

I can create a project in eclipse, compile/ run hello world etc. My question is, when it comes to my second program, do I need to create a completely new project?

I would have thought I could just open a new source file in eclipse within a given project, compile, run it, and so on, but this doesn't seem to be the case. The run configurations seem to need adjusted all the time. Is the simplest way forward for me to work through my example bits of code to create a new project for each one?

Many Thanks
John
Re: Newbie question, my 2nd program. Is a new project for a new program? [message #1293322 is a reply to message #1288081] Sat, 12 April 2014 14:21 Go to previous messageGo to next message
Timothy Golden is currently offline Timothy GoldenFriend
Messages: 6
Registered: April 2014
Junior Member
Due to the tremendous number of options in Eclipse I am hesitant to say that it is one executable per project, but I believe that is the correct way to look at the designers' intentions.

I have some mathematics research code which has dozens of standalone main() executables that I've been building from a makefile for years. I wanted to do a full eclipse importation into one project, but it has been challenging. I have tried many of the options and not gotten good results.

There are probably many workarounds, but if you are starting out I would think a good option would be to unify those many executables into one executable that makes use of command line options. This is generally the style of linux systems like apt-get and so forth. I haven't gotten there yet. I think I'm still going to search for a workaround because I am stubborn. That said, I may be quite wrong and just haven't found the way to implement multiple main() executables in one project. I think my next step will be to experiment with the makefile type project. I haven't tried it in eclipse yet.

An IDE of this type used to cost serious money, and in fact I don't believe that any have taken on as much as the eclipse developers have. As I wade through the configuration options I see just how many considerations they've attempted to consider. Very impressive. I just hope that they can keep it together as accumulation unfolds. It is rare that a design philosophy meets everyone's needs, but I accept the eclipse way. Now if I can just get it working...

Re: Newbie question, my 2nd program. Is a new project for a new program? [message #1383874 is a reply to message #1293322] Mon, 26 May 2014 15:50 Go to previous message
Timothy Golden is currently offline Timothy GoldenFriend
Messages: 6
Registered: April 2014
Junior Member
If you insist on keeping src files in one directory across multiple projects, and I happen to like this model during development, then it is possible to link files to a project within eclipse:

right click the project folder in eclipse and select import; filesystem;
select files and click on the Advanced button, which will give you a checkbox to link to those files. In the project folder you'll see the icon has additional detail indicating linked files. The eclipse help is present on this so please use it.

Using this feature is confusing, but I am trying it and it seems stable. A formal system should likely implement a library as a separate project to be shared among multiple binary applications, but during development it is useful to test code from multiple main() instances, and this method works, but is clunky. For instance if you create a new file for a 'linked' project you will have some extra steps.

The other way to go would be one main() with argument processing to reach the development code.

- Tim
Previous Topic:arm remote debug loses executable flag
Next Topic:Eclipse CDT and ARM ?
Goto Forum:
  


Current Time: Tue Apr 23 17:29:35 GMT 2024

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

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

Back to the top