tags:

views:

188

answers:

1

How can I add a new Executable in my XCode project?

Hi,

I add a .cpp file in my XCode project. And the xcode project compiles fine afterward.

#include <iostream>
using namespace std;

int main(int argc, char **argv) {
    cout << "Starting main " << endl;
}

But how can I execute that main in my xcode project? I assume I need to create a new custom executable. And I have read http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/080-Defining%5FExecutable%5FEnvironments/executable%5Fenvironments.html

What I don't know what to put is the path of the executable. What should I put? I just create a .cpp file with a 'main'.

Thank you.

A: 

Right click on Targets and the create a new target. The executable will be created automatically.

You only need to define custom executables explicitly when (a) you have a legacy makefile project or (b) you are developing some kind of plug-in which will run with a third party application.

Paul R