Personal tools
You are here: Home documentation developer Pd externals in Xcode
Views

This page is meant to be a short tutorial on how to build a Pd external in Apple's Xcode. In particular, it explains how to build the "hello world" example from the Pd externals Howto.

The following is what has to be done in Xcode 2, nevertheless Xcode 3 is quite the same in this respect.

Prerequisites

First of all, you need to download the Pd source code from the downloads section and unpack it. As far as this tutorial is concerned, the actual location of the files doesn't matter, but we'll need the source code later to invoke m_pd.h.

1. Setting up the project

Having started Xcode, first create a new project. the project type you're looking for is "BSD Dynamic Library" in the "Dynamic Library" section.

In the main window, select the target with the name of your project (probably there's only one anyway) and open the target informations (e.g. via command-i)

Click the "Build" button in the upper section of the window. Look for the following settings and change them to these values:

  • "Other linker flags": -undefined dynamic_lookup (seems to be necessary)

  • "Product Name": helloworld

  • "Executable Prefix": none necessary, just delete it

  • "Executable Extension": pd_darwin

2. The source files

We only need two source files for our project:

  • m_pd.h Look for it somewhere in the pd source code, add it to your project (the easiest way is to drag it from the Finder into the "Source" folder) and just click "yes" on the "Add to target" dialog.

  • helloworld.c

  • create the file via File > New File > C File (in the BSD Section) - you don't need to create the corresponding header file.

  • Just copy the source code from the externals-howto into it and save.

3. Build the target

Nothing more to say about this - just be careful with the "Debug" and "Build" settings - you could have changed the target settings for one and try to build the other.

4. Move the product file

The last step is to move the resulting helloworld.pd_darwin from Xcode's build directory to a directory that pd knows about - which is for instance /Library/Pd/ (maybe has to be created first)

5. Start Pd

The external should be available now.



Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser