Mac OS XXcode

team bbl


Apple makes it easy for developers to create Mac OS X applications by providing Xcode, a free IDE and front-end for GCC. Xcode is a rich IDE, and this short guide is not intended to replace books or other resources on all of Xcode's features and options. Fortunately, it takes only a few steps to create an Xcode project and add the necessary build flags for wxWidgets.

1.

Create a New Project (File menu).

2.

From the New Project Assistant, select Empty Project for the project type.

3.

Select the location for your project files.

4.

From the Project menu, select New Target and choose Carbon/Application. This will tell Xcode that you are creating an application. You will be asked to provide a name for the target. The Target Info window will then appear, allowing you to change the configuration for the new target.

5.

From the Settings drop-down menu, choose Language under GNU C/C++ Compiler, and find the Other C++ Flags option. This is where you will paste the results of using wx-config --cxxflags from the command line (see the later section "Using wx-config"). These flags are the necessary header includes and defines to build your wxWidgets application.

6.

From the settings drop-down menu, choose Linking under General, and find the Other Linker Flags option. This is where you will paste the results of using wx-config --libs from the command line. The libs are the necessary libraries for linking wxWidgets as well as linking the necessary Mac OS X system files.

7.

You can now add your wxWidgets source files to the project by selecting Add to Project from the Project menu. Because you have provided Xcode with the necessary flags from wx-config, your wxWidgets programs will compile and link right from within Xcode.

Your Xcode project will also contain a file matching your project's name, ending in .plist. This is an XML file that contains information about your application and is included in your application bundle. On Mac OS X, every application is actually an application bundle, a complete directory with a hierarchy of files that are part of the application. This allows Mac OS X programs to be easily copied and moved as a single icon from Finder while still giving developers a chance to include any needed auxiliary files. For example, interface translations can be a part of the application bundle, so the application can be shown in the user's native language without downloading any additional files.

Xcode allows you to specify multiple targets and multiple build styles for each target. For example, Xcode automatically creates deployment and development build styles for each target. If you want to be able to create both debug and release versions of your application, you could place the wx-config flags specifying the different library configurations into the build styles rather than the target, giving you the flexibility of choosing to build a debug or a release simply by switching your build style.

    team bbl



    Cross-Platform GUI Programming with wxWidgets
    Cross-Platform GUI Programming with wxWidgets
    ISBN: 0131473816
    EAN: 2147483647
    Year: 2005
    Pages: 262

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net