tags:

views:

41

answers:

1

Hi,

I've a project that must produce two executables: the main application and an executable that is called by a separate process.

I've created the second file in Xcode and added a second target of type Cocoa Shell Tool. I can now build the second executable but when I try to build my project normally I get an error saying there's two executables present:

ld: duplicate symbol _main in <path>/SecondExecutable.o and <path>/main.o

(<path> was added by me to protect the innocent and their intelectual property).

How can I configure Xcode to build both at the same time?

+3  A: 

Make sure that your app source file is only in the app target, and the tool source file is only in the tool target.

JWWalker
The easiest way to do this is to select each file, choose Get Info, and look at the Targets tab: each main should only have one target checked.
cdespinosa