noob string concatenation help.

anupam kapoor anupam.kapoor at gmail.com
Fri Apr 13 04:56:02 PDT 2007


hi all,

i am trying out a trivial string concatenation sample like this :

,----
| void do_string_test()
| {
|         char[] s;
|         writefln("Length: %d\tString: '%s'", s.length, s);
|         
|         s ~= "something ";
|         writefln("Length: %d\tString: '%s'", s.length, s);
|         
|         s ~= "whatever";
|         writefln("Length: %d\tString: '%s'", s.length, s);
| }
`----

however, i get the following link errors:

gcc string.o -o obj/string-test -m32 -lphobos -lpthread -lm 
string.o: In function `_Dmain':
string.d:(.gnu.linkonce.t_Dmain+0x45): undefined reference to `_d_arrayappendT'
string.d:(.gnu.linkonce.t_Dmain+0x78): undefined reference to `_d_arrayappendT'
collect2: ld returned 1 exit status
--- errorlevel 1

can you please help ? is my installation br0ken ? i have used stuff from the wiki4d for setting up
the environment.

thank you
anupam


More information about the Digitalmars-d-learn mailing list