tags:

views:

173

answers:

2

I've been playing around with D for a few days and was getting quite excited about it until, that is, I tried to get gtkd working. I've now wasted the best part of 3 days trying to get a working setup and am beginning to get (read; long ago got) a bit demoralised. I was wondering if anyone can help before I give up. A lot of the information I can find online is outdated so I'm not sure if I'm even right in thinking this is even possible.

The rest of this is just about what I've tried so far and you may not need to read it if you have a quick solution, so feel free to jump to ... [Jump to here]

So, firstly I need to know, is tango actually available for use with D2.0, I believe that it wasn't originally but now D2.x is such that you can use tango and phobos alongside each other. If this isn't true, then I guess I've fallen at the first hurdle and this is a non-starter.

The steps I've taken so far.

  1. I installed gdc from the ubuntu repositories
  2. I installed libtango-headers from the repos (note, headers only, no libs available, so that's not much help)
  3. I manually installed dsss

This setup would compile D but when I came to installing gtkd (with dsss), it compiled but I got all sorts of errors (relating to tango) when trying to compile anything using it. Well, as I've mention I didn't have the libs so this shouldn't have been unexpected. I tried to install the tango libs manually but still got loads of errors and in the end resorted to a dsss net install tango which warned me that I wouldn't be able to go back to phobos (something which confused me as as I have mentioned I thought the two could be used alongside each other) anyway, I proceeded and it completely screwed my setup. I couldn't compile any D now.

Sorry I couldn't be more explicit about what errors I got in that last section, I honestly don't remember.

Anyway, I removed everything I had installed. And started afresh.

  1. I installed gdc from repos
  2. I installed dsss manually

I now read that the latest tango doesn't work with gdc (not sure if this is true) so I

  1. Got the deb for dmd and installed that.
  2. Installed the latested tango (libs and headers) manually.
  3. Installed gtkd with dsss

Now I can't get dsss to recognize dmd, so can only use gdc with it. That however doesn't find tango. If I use dmd directly it finds tango and gtkd but I get errors about volatile statements being deprecated. Something which is apparently true in D2.x, which brings me back to "is tango even supported".

Gosh I'm confused!

[Jump to here]

If anyone can give me step by step instructions on how to get a working setup set up, I'd be forever grateful!

Thanks, T.

Update: "We're there!"

So I downloaded dmd.2.049.zip from http://www.digitalmars.com/d/download.html and extracted to my home directory and did a export PATH = $PATH:~/dmd2/linux/bin (thanks to dsimcha).

Forgot about dsss. Got the svn version of gtkd as per the instructions at http://www.dsource.org/projects/gtkd/wiki/UsingSubversion. Edited GNUmakefile to change the prefix to /home/me/dmd2/linux and did a make install.

Edited ~/dmd2/linux/bin/dmd.conf so the include paths included ../include (the gtkD libs are put in ../lib so I didn't need to edited the library paths).

Now finally to compile with gtkD I needed to link against libgtkd and libdl, this was done by, dmd mydprog.d -L-lgtkd -L-ldl(thanks to jpf).

+5  A: 
  1. Tango does not work with D2. There was some effort a long time ago towards porting it, but this kind of hit a wall and it's unclear whether this is ever actually going to be finished. OTOH Phobos for D2 is much better than Phobos for D1, so lack of Tango is not as bad as it sounds.

  2. GDC supports an ancient version of D2. There's absolutely no chance of gtkD compiling with it. You should use the reference DMD compiler.

  3. Generally the proper way to set up DMD on Linux is to simply unzip dmd.2.0xx.zip into your home directory and do an export PATH = $PATH:~/dmd2/linux/bin to make sure the DMD executable is in your path. Then everything should work (with DMD2 and Phobos).

dsimcha
Thanks that clears a lot up. I feel better now :). Any idea how to get gtkd working though. I've got `dsss` compiling it just with Phobos now and `dmd` setup as you suggested. I've tried installing it (gtkd) into `prefix=~/dmd2/linux/` and editing the `dmd.conf` to change the include directories but no luck.
tjm
Ok a bit of luck, I've put an edit in my post to explain the current situation; now I'm getting linker errors.
tjm
+3  A: 

If you want dmd to pass arguments to the linker you have to prefix them with -L. I think for gtkd you need to link to the gtkd library and libdl.

-L-lgtkd -L-ldl
jpf
Fantastic, thankyou. I'd seen the -L flag and had tried `-Lgtkd` and `-Llgtkd` but didn't ever think of `-L-l...`. It all works now.
tjm