Views
Personal tools

XcodeTemplate

From X-Plane SDK

Revision as of 00:59, 21 March 2012 by Bsupnik (Talk | contribs)
Jump to: navigation, search
This page was imported from the previous wiki engine. It needs a review and cleanup of formatting. Please see this page for more information.

Ben says that all CFM plugins should use a shlb and Mach-O plugins should use a dylib. (X-Plane supports bundles but cross-platform plugins cannot use any of the features that a bundle gives you over a dylib, so there is no reason to use a bundle.)

As of X-Plane 9, OS 9 support has been completely dropped, and hence CFM plugins will become a thing of the past. Therefore the following instructions were made for dylib based plugins running in OS X.

Contents

Instructions

The following instructions were created for Xcode 3 on Mac OS X 10.5, but should be applicable for Tiger users with no modification.

To create a project with the proper target settings, you should do as follows:

  1. Create a new project using Dynamic Library > Carbon Dynamic Library as the starting point. (Carbon does have some use in plugins, though you want to avoid it as much as possible to keep cross-platform compatibility at a maximum.)
  2. When changing the target's settings, be sure to change them for both release and debug!
  3. Change the Base SDK Path to __/Developer/SDKs/MacOSX10.4u.sdk__ so that Tiger user and Leopard users can run your plugin.
  4. Change the Executable Extension to: __xpl__
  5. Set the Other Linker Flags to: __-flat_namespace -undefined warning__%%% Note that you can change warning to suppress if the warnings are bothering you.
  6. Set the Header Search Paths to the following two entries:%%% __$(XPSDK_ROOT)/CHeaders__%%% __$(HEADER_SEARCH_PATHS)__%%% Be SURE to make the CHEaders path search __recursively__, or you'll have to manually add all the sub paths as separate entries.
  7. Set the Preprocessor Macros to: __APL=1 IBM=0 LIN=0__
  8. Disable __Fix & Continue__.
  9. Define the user constant __XPSDK_ROOT__ and point it to the SDK. If the SDK is in the project direcoty, this is just the name of the SDK directory.

Download

If you are using Xcode 3, I have already done all this work for you, as well as created an initial source template that outlines the required functions. You can download this installer from [1]

__This template comes with SDK v2.0b2 pre-installed!__ This may __NOT__ be the latest. You should check the [Download] page for newer releases of the SDK, and follow the directions below for updating it yourself.

Read the included README.TXT for install directions.

SDK Version and Location

A mentioned the downloadable template comes with SDK v2.0b2 pre-installed! This may NOT be the latest SDK build. You should check the [Download] page for newer releases of the SDK, and follow the directions below for updating it yourself.

(Ben and Sandy have made it very clear that they recommend keeping your SDK folder external to your project, and don't like the idea of having it pre-installed in the template. There are many advantages to this. However Jeff has built the Xcode project template to include the SDK for personal reasons and has decided to distribute it as is. He will do his best to keep this package up-to-date.)

It is very easy to customize the template to either update the SDK version copied into your new projects, or to centralize the SDK directory that the template uses.

The former can be done by simply exchanging the SDK directory in the project for the new SDK folder. Anything in SDK/CHeaders will automatically be searched for headers. The latter can be accomplished by opening the template project itself in Xcode, and setting XPSDK_ROOT to point at your centralized SDK directory.

Acknowledgements

Thanks to Sandy Barbour for the large number of compilable examples he has provided. This template is based off of his hard work.

Thanks to Ben Supnik for all his help and hard work on the SDK.

Thanks to [Bob Feaver | mailto:BFeaver@mac.com] for hosting this template so that others may enjoy it, and for updating the original wiki instructions that lead me down this path.

Thanks to [Ben Russell | mailto:br@x-plugins.com] for posting the original wiki page instructions.

Thanks to [Jeff Reinecke | mailto:jeff@paploo.net] for re-writing this page to use the dylib based instructions.

Navigation
TOOLBOX
LANGUAGES
Toolbox