How do I build a C++ program as a .app program?

Discussion in 'Mac Programming' started by zrbecker, Mar 18, 2011.

  1. zrbecker macrumors member

    Jun 28, 2009
    I am trying to build a c++ program I wrote as a stand alone .app that I can distribute. I didn't notice till now that it is just building a unix executable.

    I am using Xcode 4.

    Also if my program has dependencies on libraries can I package them with the app or do I have to get people to install the libraries?

  2. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
  3. kainjow Moderator emeritus


    Jun 15, 2000
    Easiest way is to create a new Cocoa application Xcode project, and then strip out all the source code, resources and frameworks and add in your source files.

    To package libraries you need to build them as frameworks or dylibs and setup Copy Build Phases to copy them into your .app.

    What does your C++ app do? If you don't have a GUI might be better to use Package Maker and create an installer that installs the libraries and your executable.
  4. zrbecker thread starter macrumors member

    Jun 28, 2009
    It is an allegro application.

    I try building it as a framework using cmake, but I couldn't get the framework to work correctly. I'll check out the link posted and the dylibs thing. Thanks

Share This Page