Where did you added the main.cpp? A multitarget project consists of a "root" project (which you will make) and subprojects. The "root" project contains:
Qt Code:
  1. TEMPLATE = subdirs
To copy to clipboard, switch view to plain text mode 
and directives controlling the order or making the subprojects. Either the "depends" directives
Qt Code:
  1. <build next>.depends = <build first>
To copy to clipboard, switch view to plain text mode 
for example
Qt Code:
  1. testapp.depends = library
To copy to clipboard, switch view to plain text mode 
(more such directives can be present) or the "ordered" directive:
Qt Code:
  1. CONFIG += ordered
To copy to clipboard, switch view to plain text mode 
in the later case, the subprojects will be made in the order they have been added to the project. No SOURCES directive in the main project (see Chris post).

Supposing you are using Creator, do the following:
(1) Create the root project. It will contain only one line for now.
Qt Code:
  1. TEMPLATE = subdirs
To copy to clipboard, switch view to plain text mode 
Save.
(2) Add a subproject: Right-click the "root" project directory and select "Add Subproject". Select the name of the subproject (for example testapp). This will create a subdirectory "testapp". Create a profile for testapp. It must be testapp.pro, otherwise the profile won't be found. The testapp subproject is a "full sized" project containing sources (for example main.cpp) resources and other things.
(3) Add another subproject.
...
(4) Return to the root project and specify dependencies.
(5) Go to the configuration page of the Creator and select what it should make: Select "Run" and set the root project.