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

Linking problem with tango.stdc.stringz

Moderators: kris

Posted: 02/24/09 19:51:44


I tried a simple script:

{{{module test; import; import tango.stdc.stringz;

int main( char[][] args ) {

toStringz( "test" ); return 0;

} }}}

There is no problem about the io.Console. But as soon I add the stdc.stringz I get the following problems while calling: gdc test.d -o test -fversion=Posix -fversion=Tango -lgtango

This is the error I get: /tmp/ccg4V1fL.o: In function `_Dmain': test.d:(.text+0x55): undefined reference to `_D5tango4stdc7stringz9toStringzFAaZPa'

Does someone has an idea? I already had this problem on Windows and Linux.

Author Message

Posted: 02/25/09 08:06:50

Could you also test some other simple import (not in tango.stdc)?

There is a possibility that stdc.stringz is missing from libgtango, but it sounds a bit unlikely.

Posted: 02/25/09 19:20:59

Also having problems with tango.util.Convert which has problems with tango.text.convert.Integer. But default things like io.Console or io.FileConduit? don't have any problems.

module temp;
import tango.util.Convert;

int main( char[][] args )

	return 0;

Gives the error: ./_temp.o:(.data+0x60): undefined reference to `_D5tango4util7Convert12ModuleInfoZ' ./_temp.o: In function `_D5tango4util7Convert18T8toStringTAaTiZ8toStringFiZAa': temp.d:(.text._D5tango4util7Convert18T8toStringTAaTiZ8toStringFiZAa[_D5tango4util7Convert18T8toStringTAaTiZ8toStringFiZAa]+0x1c): undefined reference to `_D5tango4text7convert7Integer8toStringFlE5tango4text7convert7Integer5StyleE5tango4text7convert7Integer5FlagsZAa'

module temp;
import tango.text.Text;

int main( char[][] args )
        auto dst = new Text!(char);

        foreach (element; Util.patterns ("all cows eat grass", "eat", "chew"))
                 dst.append (element);

	return 0;

This works

module temp;
import tango.text.convert.Integer;

int main( char[][] args )
        toString( 12 );

	return 0;

Does not work: ./_temp.o: In function `_Dmain': temp.d:(.text+0x20): undefined reference to `_D5tango4text7convert7Integer8toStringFlE5tango4text7convert7Integer5StyleE5tango4text7convert7Integer5FlagsZAa'

Posted: 02/25/09 23:04:42

Could you use nm on your libgtango and see if the missing symbols really are missing? In which case you may have a bogus library file ... How did you get the library in any case?

Posted: 02/26/09 21:21:42

Okay.. Due to your tip I found the problem. It was something stupid. There was not the same version in the /usr/include/d/tango-gdc folder. I only copied it to the /usr/include/d/tango folders :( But now everything works fine :)

But thanks for your help. :)