================================================================================
How to Code::Blocks with Tango on Ubuntu 8.10 (amd64)
================================================================================
I write this assuming you want to write in Digitalmars D with Code:Blocks as
your IDE and gdc as compiler. It took me quite a while my self to figure
out on how to get things set up properly. To I decieded to write this.
I use Ubuntu 8.10 my self, but this should apply to other distries too.
1. Install gdc and codeblocks through the paket manager:
sudo aptitude install gdc
sudo aptitude install codeblocks
#you might need this too, also im not sure
sudo aptitude install build-essential
2. Next we install the tango library:
For amd64 run:
wget http://downloads.dsource.org/projects/tango/0.99.7/tango-0.99.7-gdcr243-gdc-x86_64-unknown-linux-gnu.sh
Note: If you happen to have downloaded installers that include dsss you might not
have libgtango.a which we will need later.
2.1 Install Tango:
chmod u+x tango-0.99.7-gdcr243-gdc-x86_64-unknown-linux-gnu.sh
sudo ./tango-0.99.7-gdcr243-gdc-x86_64-unknown-linux-gnu.sh
This will install tango on your computer, most likely the files are then in /usr/lib
and /usr/include/d but it might also be possible that they are in /usr/local/lib or
/usr/local/include/d
3. Add the right configuration settings to Codeblocks:
In Codeblocks go to Settings->Compiler and Debugger... there you select the "GDC D Compiler".
3.1 Compiler Settings
In the first tab "Compiler Settings" go to #defines and add:
type "Posix" and "Tango" into the field.
3.2 Linker Settings
In the Tab "Linker Settings" add "/usr/lib/libgtango.a" and "/usr/lib/libgphobos.a"
or use "/usr/local/lib/libgphobos.a" and "/usr/local/lib/libgtango.a", depending
on where the installer put your libraries.
3.3 Search Directories
In the Tab "Search Directories" you have to add "/usr/include/d" or "/usr/local/include/d"
depending on where the tango stuff got installed
3.4 Toolchain executables
Then go to the Tab "Toolchain executables" which might be hidden further right. gdc is either in
/usr/bin or /usr/local/bin. If its not there just run:
which gdc
And it will tell you.
Adjust the compilers installation directory according, if its not set right.
4. Testing your settings:
Create a new D Project and try to compile the test code. Also add a line like:
import tango.io.Console; and compile it, to see if the libraries are installed correctly.