Hey all,
Suppose I want to have a solution that contains more than one program
(i.e., multiple main() methods, each in different files, and possibly in
different projects within the solution). For instance, I often have at
least one main application, and several small test programs that I use
to debug the code base. At present, I have a separate solution and
project for each one, and that project contains all the same library
files, but only one .cpp file with a main method. Of course, the problem
with this setup is that if I add files to the library, I have to
manually add these files to each project. I guess what I am looking for
is a way to add the library files once (i.e. to one project).
Thanks.
Dave
Andrew McDonald - 16 Nov 2006 21:14 GMT
"Dave Rudolf" <dave.rudolf@usask.ca> wrote...
> Suppose I want to have a solution that contains more than one program
> (i.e., multiple main() methods, each in different files, and possibly in
[quoted text clipped - 6 lines]
> files to each project. I guess what I am looking for is a way to add the
> library files once (i.e. to one project).
You can't have more than one main() in a project - a project by definition
builds one executable or library. You could easily have all your projects in
one solution though - why have a separate solution for each one? When you
hit Run or Debug, the startup project is the one executed, which you define
through the Solution Explorer context menu.
As for the library, you should make a static or dynamic library project and
simply add a dependency on that library to each of your executable projects.
--
Andy