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

Problems installing DMD/Tango on linux

Moderators: kris

Posted: 04/23/07 12:00:56

Hi,

I am (an enthusiastic) newbie to D. I installed dmd v1.013 with phobos and got this working ok with some simple programs using phobos. After reviewing the forums I decided that Tango was probably the sensible route to follow as this seems to be the preferred library for use with D. I then downloaded and installed tango-0.97-src and installed this as per the instructions. My platform is linux fedora core 5 on AMD64. After building and installing Tango, my structure is;

/usr/local/bin (dmd, obj2asm, etc)
/usr/local/lib (libphobos.a,libtango.a,libphobos.a.phobos)
/usr/local/import/v1.013/dmd - copied from dmd/src/dmd
/usr/local/import/v1.013/phobos - copied from dmd/src/phobos
/usr/local/import/v1.013/object.di - from tango
/usr/local/import/v1/013/std - from tango
/usr/local/import/v1/013/tango - from tango
/etc/dmd.conf contains;
[Environment]
LIB=%@P%/../lib
DFLAGS=-I/usr/local/import/v1.013 -version=Tango -version=Posix -L-L/usr/local/lib

Then for simple.d...

import tango.io.Console;
void    main()
{
  Cout("Hello, World").newline;
}

dmd -c simple.d works ok, but
dmd simple.d gives missing references on the link;

gcc simple.o -o simple /usr/local/lib/libtango.a -m32 -Xlinker -L/usr/local/lib -lphobos -lpthread -lm
simple.o:(.data+0x30): undefined reference to `_D5tango2io7Console12__ModuleInfoZ'
simple.o: In function `_Dmain':simple.d:(.gnu.linkonce.t_Dmain+0x10): undefined reference to `_D5tango2io7Console4CoutC5tango2io7Console7Console6Output'
collect2: ld returned 1 exit status

Then reading that you should either include libtango.a in DFLAGS to use dmd, or use bud, I firstly added /usr/local/lib/libtango.a to the DFLAGS line in /etc/dmd.conf. This still produced the above errors.

I then downloaded bud and tried to install this. On the first step;

make -f Makefile.unix I get the following errors;

dmd -op -release -inline -ofbuild build.d util/pathex_bn.d util/pathex.d source_bn.d util/str.d build_bn.d util/booltype.d util/fdt_bn.d util/str_bn.d source.d util/fdt.d util/fileex.d util/fileex_bn.d util/linetoken.d util/linetoken_bn.d util/macro.d util/file2.d
build.d(56): Identifier expected following package
build.d(56): ';' expected
build.d(634): identifier expected following '.', not 'macro'
build.d(3348): identifier expected following '.', not 'macro'
source.d(55): Identifier expected following package
source.d(55): ';' expected
source.d(105): Identifier expected following package
source.d(105): ';' expected
source.d(483): identifier expected following '.', not 'macro'
util/macro.d(38): Identifier expected following package

I then downloaded DSSS, but when I couldn't find any installation procedure for that and it is not obvious to me which files should be copied to my system and which not, I decided it was time for help.

Can anyone advise where I'm going wrong.

Regards, Adrian.

Author Message

Posted: 04/27/07 18:31:11

I'm afraid Tango is not fully operational on AMD64 at this point. It's very close, but there's an implementation difference between GDC and DMD regarding the use of _argptr which is messing things up. This means you can't use a number of principal classes in Tango at this time.

We're hoping the next GDC release will address the problem

Posted: 06/16/07 18:37:55

I had the same problem with compiling bud and the problem is that bud seems to be a bit old because now there is a "macro" keyword in D. Just rename the util/macro.d file to something and the module name in util/macro.d and then do a search and replace in the source.d and build.d file for util.macro and replace it with something