Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Installation Guide for Tango used with GDC on Mac OS X

This page details ways of installing Tango for GDC on Mac OS X.

Install Packages

These packages are intended for Mac OS X 10.4 "Tiger", with Xcode Tools 2.4.1
or Mac OS X 10.5 "Leopard", with Xcode Tools 3.1 (gcc-5484) or 3.0 (gcc-5465).

Universal binaries are provided, meaning they work on both PowerPC and Intel.
The compilers also have 32-bit and 64-bit support, for each of those architectures.

The next major release, aimed at the illusive GDC 0.25, is scheduled to have
support for Xcode 3.1.2 and the Apple gcc-4.2 compiler (as opposed to gcc-4.0).

The packages install under /usr, next to the regular GCC files from Xcode Tools.
Uninstall programs are provided, to remove the files installed by the packages.


gdc-trunk-r229-mac-10.4.dmg (GDC.pkg)

gdc-trunk-r229-mac-10.5.dmg (GDC.pkg)

gdc-0.24-macosx-universal-gcc-5363.tar.bz2 (the 0.24 release doesn't work with Tango)


dsss-0.75-gdc-mac-10.4.dmg (DSSS.pkg)

dsss-0.78-gdc-mac-10.4.dmg (DSSS.pkg)


tango-0.99.7-mac-10.4.dmg (Tango.pkg)

tango-0.99.8-mac-10.4.dmg (Tango.pkg)


tangobos-trunk-r59-mac-10.4.dmg (Tangobos.pkg)

Using Tango



void main()
    Cout ("Hello, sweetheart \u263a").newline;

The default configuration of the Mac OS X Universal packages for GDC and DSSS will try to use Phobos, so there's some minor extra configuration parameters needed for them to use Tango instead. This is so that they set the Tango/Posix versions and to include the Tango library when not using "build".

With GDC

gdmd -version=Tango -version=Posix hello.d -L-lgtango


all: hello

%.o: %.d
	gdc -fversion=Tango -fversion=Posix -c -o $@ $<

hello: hello.o
	gdc -o $@ $^ -lgtango

        rm -f *.o hello


rebuild -dc=gdc-posix-tango hello.d


name = hello

target = hello
dsss build -dc=gdc-posix-tango


xcode settings for tango

The Xcode IDE has good support for D, when using the plugin.

Note: Xcode will by default use /usr/bin/gcc to link (not gdc), so it needs an extra -lgphobos argument.


Using Tangobos


version(Tango) { import std.compat; }
import std.stdio;

void main()
   writefln("Hello, World!");

To be able to compile code that uses Phobos with Tango, the Tangobos library needs to be installed.

When not using a build tool, you need to include the "gtangobos" library before the "gtango" library.

gdmd -version=Tango -version=Posix hello.d -L-lgtangobos -L-lgtango

Universal Binaries

If you are building for Intel on a PowerPC, so that the system doesn't have the required architecture without using a -isysroot parameter, then the easiest installation setup to be able to use D is to add symbolic links from the SDK to the regular libraries:

sudo ln -s /usr/lib/libgphobos.a /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libgphobos.a
sudo ln -s /usr/lib/libgtango.a /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libgtango.a

Then you should be able to build Universal Binaries with the usual -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk parameters to GCC/GDC. When building on Intel you only need this setup if cross-compiling.


  • xcode-tango.png (43.8 kB) -xcode settings for tango, added by afb on 04/28/08 11:50:27.