www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - tango on linux

reply Alberto <reda zioale.it> writes:
I have trouble to use tango on linux.
I have tried both gdc and dmd, and they give me the same error:

lab console # dmd hello.d
gcc hello.o -o hello -m32 -lphobos -lpthread -lm
hello.o:(.data+0x30): undefined reference to
`_D5tango2io7Console12__ModuleInfoZ'
hello.o: In function `_Dmain':
hello.d:(.gnu.linkonce.t_Dmain+0x10): undefined reference to
`_D5tango2io7Console4CoutC5tango2io7Console7Console6Output'
collect2: ld returned 1 exit status
--- errorlevel 1

On windows it works for me, but in linux no..

lab lib # dmd
Digital Mars D Compiler v1.005

lab lib # ls -l /usr/lib/libphobos.a
-rw-r--r-- 1 root root 504144  9 feb 20:59 /usr/lib/libphobos.a

lab lib # cat /etc/dmd.conf
[Environment]
DFLAGS="-I/usr/include/tango" -version=Posix -version=Tango

I have compiled tango from source with success, I have copied
libphobos.a/libgphobos.a in /usr/lib, tango dir on my include path of
dmd/gdc and changed properly dmd.conf/libgphobos.spec
I have also tried to use the lib dir for dmd 1.005/gdc 0.22 as suggested
in the mango site, but nothing..

I don't understand :\
It's a tango problem or just I did something wrong?
Feb 09 2007
parent Sean Kelly <sean f4.ca> writes:
Alberto wrote:
 I have trouble to use tango on linux.
 I have tried both gdc and dmd, and they give me the same error:
 
 lab console # dmd hello.d
 gcc hello.o -o hello -m32 -lphobos -lpthread -lm
 hello.o:(.data+0x30): undefined reference to
 `_D5tango2io7Console12__ModuleInfoZ'
 hello.o: In function `_Dmain':
 hello.d:(.gnu.linkonce.t_Dmain+0x10): undefined reference to
 `_D5tango2io7Console4CoutC5tango2io7Console7Console6Output'
 collect2: ld returned 1 exit status
 --- errorlevel 1

I'm guessing you aren't using Bud or a similar tool? The user-level Tango code isn't in the packaged static library.
 On windows it works for me, but in linux no..

Strange that it would work for you on Windows though. Sean
Feb 10 2007