You cannot have more than one main
in a project.
However you can modify a projects run command, per Microsoft:
- Select the solution in Solution Explorer and then choose "Properties" on the context menu.
- Select "Common Properties", "Startup Project" on the "Properties" dialog box.
- For each project that you want to change, choose either "Start", "Start without debugging", or "None".
EDIT:
So you're saying rather than wanting to run in parallel you want to build in parallel, in the same project.
That's a really nasty hack as described here: https://stackoverflow.com/a/4775245/2642059
Just bear in mind if you try you're going against Visual Studio's design. Think of it like using a pistol to bring down an elephant cause you don't like how long it takes to load the elephant gun.
EDIT:
Before:
Test.cpp:
int main(){
return 0;
}
Test2.cpp:
int main(){
return 2;
}
After:
Test.cpp
int test(){
return 0;
}
Test2.cpp
int test2(){
return 2;
}
main.cpp
int main(int argc, char* argv[]){
if(argc > 1 && atoi(argv[1]) == 2){
return test2();
}
else
{
return test();
}
}