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

How do you configure rebuild to work with Tango?

Moderators: larsivi kris

Posted: 05/19/09 22:01:38

I have Eclipse + Descent + DMD + Tango + DSSS/Rebuild installed and working properly on Ubuntu 9.04, except that when I try to use rebuild to compile a program (importing a tango library) in Eclipse, it gives me a bunch of linking errors:

./tango.io.device.Conduit.o: In function `_D5tango2io6device7Conduit7Conduit5_ctorMFZC5tango2io6device7Conduit7Conduit':
Conduit.d:(.text+0xe): undefined reference to `_D5tango4core6Thread5Fiber7getThisFZC5tango4core6Thread5Fiber'
./tango.io.device.Conduit.o: In function `_D5tango2io6device7Conduit7Conduit5errorMFAaZv':
Conduit.d:(.text+0x184): undefined reference to `_D5tango4core9Exception11IOException7__ClassZ'
Conduit.d:(.text+0x1a1): undefined reference to `_D5tango4core9Exception11IOException5_ctorMFAaZC5tango4core9Exception11IOException'
./tango.io.device.Conduit.o:(.data+0x1e8): undefined reference to `_D5tango4core6Thread12__ModuleInfoZ'
collect2: ld returned 1 exit status

Here is the program code I am trying to write:

module MyModule;

import tango.io.Console;

void main()
{
	Cout("Hello World!").flush;
}

Is there a way to configure Rebuild to work with the tango library? Perhaps through /etc/rebuild/dmd-posix-tango, or etc/rebuild/default configuration files?

Author Message

Posted: 05/20/09 15:24:10

You can either use -dc=dmd-posix-tango or put dmd-posix-tango into the default profile.

Posted: 05/20/09 16:03:22

I changed the default profile to dmd-posix-tango, and it gives me these linking errors when I compile:

./_MyModule.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
./tango.io.Console.o:(.rodata+0x70): undefined reference to `_D6object6Object5printMFZv'
./tango.io.Console.o:(.rodata+0xbc): undefined reference to `_D6object6Object5printMFZv'
./tango.io.Console.o:(.rodata+0x144): undefined reference to `_D6object6Object5printMFZv'
./tango.io.Console.o:(.eh_frame+0x12): undefined reference to `__gdc_personality_v0'
./tango.sys.Common.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
./tango.stdc.stdint.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
./tango.stdc.constants.constSupport.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
./tango.stdc.posix.sys.select.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
./tango.stdc.errno.o:(.eh_frame+0x11): more undefined references to `__gdc_personality_v0' follow
./tango.io.device.Device.o:(.rodata+0x64): undefined reference to `_D6object6Object5printMFZv'
./tango.io.device.Device.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
./tango.io.device.Conduit.o: In function `_D5tango2io6device7Conduit7Conduit5errorMFAaZv':
Conduit.d:(.text+0x1a9): undefined reference to `_d_throw'
./tango.io.device.Conduit.o:(.rodata+0x124): undefined reference to `_D6object6Object5printMFZv'
./tango.io.device.Conduit.o:(.rodata+0x1a4): undefined reference to `_D6object6Object5printMFZv'
./tango.io.device.Conduit.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
./tango.io.stream.Buffered.o:(.rodata+0x144): undefined reference to `_D6object6Object5printMFZv'
./tango.io.stream.Buffered.o:(.rodata+0x1e4): undefined reference to `_D6object6Object5printMFZv'
./tango.io.stream.Buffered.o:(.eh_frame+0x11): undefined reference to `__gdc_personality_v0'
/usr/local/lib/libtango-base-dmd.a(deh2.o): In function `_D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable':
rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x4): undefined reference to `_deh_beg'
rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0xc): undefined reference to `_deh_beg'
rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x13): undefined reference to `_deh_end'
rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x37): undefined reference to `_deh_end'
collect2: ld returned 1 exit status
--- errorlevel 1

Tango works with DMD when I try to compile on the command line. Does the dmd-posix-tango configuration file need further configuration? Here's the dmd-posix-tango file I have:

profile=tango

compiler=dmd
inifile=dmd.conf

exeext=
objext=o


version=DigitalMars
noversion=GNU
version=linux
noversion=Unix
version=Posix
noversion=Windows
noversion=Win32
noversion=Win64
version=X86
noversion=PPC
noversion=X86_64
version=D_InlineAsm
version=D_InlineAsm_X86
noversion=D_InlineAsm_PPC
noversion=D_InlineAsm_X86_64
version=LittleEndian
noversion=BigEndian
version=Tango


[compile]
cmd=dmd -version=Posix -version=Tango -c $i

flag=$i
incdir=-I$i
libdir=-L-L$i
optimize=-O
version=-version=$i


[link]
oneatatime=yes
cmd=dmd -L--start-group -L-ltango-base-dmd $i -of$o

libdir=-L-L$i
lib=-L-l$i
flag=-L$i


[liblink]
safe=yes
oneatatime=yes
cmd=ar rc $o $i

libdir=
lib=
flag=


[postliblink]
cmd=ranlib $i


[shliblink]
shlibs=no

[dyliblink]
dylibs=no

Posted: 05/20/09 16:22:57

I don't know of any obvious changes needed, may depend a bit on the version of the various components.

However, your errors suggests that you have compiled for GDC at some point? Try to add -full -clean to your rebuild command in case it got some stale files around.

Posted: 05/20/09 23:10:39

I got Tango (and gtkD) working with Rebuild now, but when I try to use Derelict with Rebuild, I get the following errors:

./_Test2Loader.o:(.data+0x78): undefined reference to `_D8derelict6opengl2gl12__ModuleInfoZ'
./_Test2Loader.o: In function `_Dmain':
/home/chris/d/eclipse/workspace/Test2Derelict/Test2Loader.d:(.text._Dmain+0xe): undefined reference to `_D8derelict6opengl2gl10DerelictGL4loadFAaZv'
collect2: ld returned 1 exit status

This is the program I'm trying to write with Derelict:

module Test2Loader;

import derelict.opengl.gl;
import tango.io.Console;

void main()
{
    try
    {
        DerelictGL.load();
        Cout("Successfully loaded the OpenGL shared library.");
    }
    catch (Exception e)
    {
        Cout("Could not load the OpenGL shared library.");
    }
}

This program was a clean build. The advise you gave in the last post help. Thanks!

Posted: 05/21/09 08:45:42

I'm not a derelict user myself, so I'm not entirely sure whats up. Normally your error messages means that the objects with the missing symbols haven't been compiled yet. Did you compile/install Derelict in any way?

Posted: 05/22/09 02:02:33

Derelict is not necessary - I was just curious if there was a quick fix. I'm new to the D language, so I've just been fooling around with it a bit. I've got gtkD and tango working, so the rest is not necessary. I can figure it out later. Thanks for the help though. :-)