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

Howto install Tango for GDC with Linux ?

Moderators: larsivi kris

Posted: 03/13/08 09:02:46 Modified: 03/13/08 22:27:45

Hello,

I'm trying to install Tango following those steps http://www.dsource.org/projects/tango/wiki/UnixInstallGdc but once the installation is finished, when I try to compile some Tango Hello World it says "Unsupported environment; neither Win32 or Posix is declared"... Some people are used to anwser "on Posix systems, you need to specify -version=Posix" to this question, but where do I need to specify this ? When I try to specify it either to the installer or to gdc it says my "unknown option"...

I'm using Ubuntu Gutsy Gibbon, with the packaged GDC, and a x86 kernel (but a Intel Core2 Duo CPU).

Thanks for any help.

Author Message

Posted: 03/13/08 09:46:19

If you want to use GDC directly, you have to use -fversion=Posix, gdmd (GDC wrapper script for DMD compatibility) also accepts -version=Posix.

Posted: 03/13/08 22:24:04 -- Modified: 03/13/08 22:28:38 by
Megasmurf

Thanks, but actualy it doesn't seem to be working...

Here is what I try to compile

import tango.io.Console;

void main(char[][] args) {
        Cout("Hello, ")("World").newline;
}

And here is what I get when I compile

23:17 remy@hal9000 ~/Dev/D% gdc -fversion=Posix testdl.d -o testdl
/tmp/ccyajQy7.o: In function `_Dmain':
testdl.d:(.text+0x2e): undefined reference to `_D5tango2io7Console4CoutC5tango2io7Console7Console6Output'
testdl.d:(.text+0x44): undefined reference to `_D5tango2io7Console7Console6Output6appendMFAaZC5tango2io7Console7Console6Output'
testdl.d:(.text+0x5a): undefined reference to `_D5tango2io7Console7Console6Output6appendMFAaZC5tango2io7Console7Console6Output'
testdl.d:(.text+0x62): undefined reference to `_D5tango2io7Console7Console6Output7newlineMFZC5tango2io7Console7Console6Output'
/tmp/ccyajQy7.o:(.data+0x30): undefined reference to `_D5tango2io7Console12__ModuleInfoZ'
collect2: ld returned 1 exit status

Or with an other command

23:18 remy@hal9000 ~/Dev/D% gdc -fversion=Posix -l tango testdl.d -o testdl
/usr/bin/ld: cannot find -ltango
collect2: ld returned 1 exit status

And when I try to compile some phobos program (a hello world) :

23:19 remy@hal9000 ~/Dev/D% gdc -fversion=Posix helloworld.d -o helloworld
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../include/d/4.1.3/std/utf.d:49: Error: identifier 'Error' is not defined
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../include/d/4.1.3/std/utf.d:49: Error: Error is used as a type
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../include/d/4.1.3/std/utf.d:49: class std.utf.UtfError base type must be class or interface, not void
(etc, it's a long way with similare lines)

Then obviously I did something wrong in installing my headers... Yes I did this step :

cd <GDC install prefix>/include/d/<GDC version>/tango
for dir in `find . -type d` ; do sudo chmod 755 $dir ; done
for file in `find . -type f` ; do sudo chmod 644 $file ; done

Posted: 03/13/08 22:55:51

Megasmurf wrote:

Thanks, but actualy it doesn't seem to be working...

Here is what I try to compile

import tango.io.Console;

void main(char[][] args) {
        Cout("Hello, ")("World").newline;
}

And here is what I get when I compile

23:17 remy@hal9000 ~/Dev/D% gdc -fversion=Posix testdl.d -o testdl
/tmp/ccyajQy7.o: In function `_Dmain':
testdl.d:(.text+0x2e): undefined reference to `_D5tango2io7Console4CoutC5tango2io7Console7Console6Output'
testdl.d:(.text+0x44): undefined reference to `_D5tango2io7Console7Console6Output6appendMFAaZC5tango2io7Console7Console6Output'
testdl.d:(.text+0x5a): undefined reference to `_D5tango2io7Console7Console6Output6appendMFAaZC5tango2io7Console7Console6Output'
testdl.d:(.text+0x62): undefined reference to `_D5tango2io7Console7Console6Output7newlineMFZC5tango2io7Console7Console6Output'
/tmp/ccyajQy7.o:(.data+0x30): undefined reference to `_D5tango2io7Console12__ModuleInfoZ'
collect2: ld returned 1 exit status

Or with an other command

23:18 remy@hal9000 ~/Dev/D% gdc -fversion=Posix -l tango testdl.d -o testdl
/usr/bin/ld: cannot find -ltango
collect2: ld returned 1 exit status

Please see here first - for GDC you need -lgtango (built and installed), or you must use a tool like dsss/rebuild.

And when I try to compile some phobos program (a hello world) :

23:19 remy@hal9000 ~/Dev/D% gdc -fversion=Posix helloworld.d -o helloworld
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../include/d/4.1.3/std/utf.d:49: Error: identifier 'Error' is not defined
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../include/d/4.1.3/std/utf.d:49: Error: Error is used as a type
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../include/d/4.1.3/std/utf.d:49: class std.utf.UtfError base type must be class or interface, not void
(etc, it's a long way with similare lines)

This is as expected unless you install Tangobos too.

Then obviously I did something wrong in installing my headers... Yes I did this step :

cd <GDC install prefix>/include/d/<GDC version>/tango
for dir in `find . -type d` ; do sudo chmod 755 $dir ; done
for file in `find . -type f` ; do sudo chmod 644 $file ; done

No, there is nothing above suggesting you did wrong when installing headers, but you're either missing libgtango, or specifying it wrongly on the ccommand line.