Welcome to Web-News
A Web-based News Reader
Subject Re: std.stream
From Ben Hinkle <ben.hinkle@gmail.com>
Date Wed, 16 Mar 2005 07:08:18 -0500
Newsgroups digitalmars.D


"novice2" <novice2_member@pathlink.com> wrote in message
news:d18p7o$d7e$1@digitaldaemon.com...
>I have dmd 0.118 and need to parse string, contain xml.
> But all xml libraries i found using stream as input data.
> So i need construct stream from char[].
> I found in TArrayStream!(char[]) in std.stream.
> But can't compile small test program.
> Any advices?
>
> #---file t.d---
>
> private import std.stream;
>
> void main()
> {
> char[] myString = "test string";
> TArrayStream!(char[]) myStream = new TArrayStream!(char[]) (myString);
> }
>
>
> #---linker error---
> t.obj(t)
> Error 42: Symbol Undefined _array_3std6stream
> --- errorlevel 1

Use MemoryStream instead. It has a constructor that takes a char[] even
though I notice that isn't listed in the doc. I will send Walter a update
for that.
The error using TArrayStream is probably due to building in debug mode but
linking against a non-debug build of phobos. So I'll probably remove
TArrayStream from the doc since it is a pain to work with (you must
pass -release to dmd). Either that or dmd.zip needs to include debug and
non-debug builds of phobos.



Recent messages in this thread
 
-# std.stream novice2 16-Mar-2005 03:03 am
.-# Re: std.stream (Current message) Ben Hinkle 16-Mar-2005 07:08 am
..\# Re: std.stream novice2 16-Mar-2005 07:53 am