[Tango] Linker error when using tango.io.file

Frank Benoit keinfarbton at googlemail.com
Sat Jul 19 16:13:16 PDT 2008


Timo Gransch schrieb:
> Hello!
> 
> After a couple of months, I wanted to write a small programm using DMD 1.028
> and Tango 0.99.6 (Jeff) on Linux. Both were installed using the install
> script from the DWT Page (
> http://www.dsource.org/projects/dwt/wiki/SetupLinux ). I use CodeBlocks
> 8,02 as my IDE.
> 
> Unfortunately my code fails to compile as soon as I try to use
> tango.io.File. 
> 
> This sample code compiles fine: 
> 
> module test;
> 
> import tango.io.Console;
> import tango.io.File;
> 
> int main()
> {
>     File f=null;
> 
>     Cout ("Test of Tango file functions").newline;
> 
>     //f=File("text.txt");
> 
>     return 0;
> }
> 
> But as soon as I uncomment the line "f=File("text.txt");", I get the
> following message when linking: 
> 
> Compiling: test.d
> Linking console executable: bin/Debug/test-tango
> /usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/libtango-user-dmd.a(tango.time.Time.o)
> (.data._D48TypeInfo_E5tango4time4Time8TimeSpan11__anonymous6__initZ+0x8):
> undefined reference to `_D10TypeInfo_l6__initZ'
> /usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/libtango-user-dmd.a(tango.time.Time.o)
> (.data._D44TypeInfo_E5tango4time4Time4Time11__anonymous6__initZ+0x8):
> undefined reference to `_D10TypeInfo_l6__initZ'
> collect2: ld returned 1 exit status
> Process terminated with status 1 (0 minutes, 0 seconds)
> 0 errors, 0 warnings
> 
> I'm linking with libpthread.a, libm.a, libtango-base-dmd.a and
> libtango-user-dmd.a. Am I missing another library?
> 
> Best regards and thanks in advance,
> Timo

The script installs a copy of tango/dsss and other stuff into the 
installation directory. There is also a shell script called dsss.sh 
which serves as starter for dsss, ensuring it uses the correct paths.
Your messages now looks like you did not use that shell script and it is 
now using another version of libtango-user-dmd.a as the one from the 
tango directory.


More information about the Digitalmars-d-learn mailing list