I just finished creating a C ++ online course for lynda.com (info here: http://cpp.bw.org/ ) using Eclipse because it is cross-platform and people can follow the exercises on different platforms. Here is how I solved this problem:
First understand how Eclipse CDT works - all the files in the project are collected and linked to each other. This means that you can only have one main()
in the whole project. Thus, creating multiple exercise files in one project will not work. Here's a simple solution:
Create a new project and select "General" β "Project" for the project type. Within this general project, merge all exercise files with it. (Right-click on the project, choose New> Folder, click Advanced in the dialog, select Link to Alternate Location.) If there are subdirectories in the directory, thatβs fine - it works great. This will be an easily accessible repository for you, and it will not be compiled.
Now create another project and select the C ++ project for the type of project (I call it "Work"). Now, for each lesson, copy the file (or files) that you will work with from the general project to the Work Project. Do exercises, play with files, etc. You still have the original files because you are working on copies, so feel free to make a lot of mistakes.
When you are finished with each exercise, simply delete the file from the "Work" and run "Clear" in the "Project" menu (this step is especially important for Windows using MingW) before copying the next set of exercise files to the "Work".
I found that this workflow works very well for this purpose.
//Bill
source share