Well you can't have two mains for one thing! One main per executable. You need to create libraries which are then used by the Cocoa application. See here