indeed when you add sources to the project, you have to select the targets you want them to belong to !!
Open up your project file (cbp with an editor),have a look at the sources part in the bottom. This is what was in your original cbp file :
<Unit filename="main.cpp" />
How does it look for yours.
In the Unit tag the targets to which it belongs to can be explicitly specified, if like in this exmaple for main.cpp nothing is specified it means it belongs to all the targets.