std.stream question
chojin
someone at somewhere.com
Fri Aug 4 01:49:53 PDT 2006
Eck. I am about to pull my hair out. I've been using D for 3 days now and
can't even get text input on the console going. The first 2 were tied up
trying to find a usable decent IDE solution.... others ironing out senseless
bugs with no documentation... and I have a computer science degree! Anyway I
feel like I could have a big rant but I'll get to the point.
I can compile most things just fine, but due to lack of finding decent
documentation for scanf I switched over to streams, which seem MUCH nicer...
but whenever I try to use them I get errors.
Currently trying to use streams using this sample code I got from dsource:
import std.stream;
import std.string;
int main()
{
char[] input;
char[] output;
// Ask for a string
std.stream.stdout.writeLine("Converts a lowercase string to
uppercase.");
std.stream.stdout.writeLine("Please enter a string:");
input = std.stream.stdin.readLine();
// Convert to upper and print it
output = input.toupper();
std.stream.stdout.writeLine(output);
return 0;
}
And consistently, when using build.exe or dmake or dmd or whatever, I
recieve this output:
dmd.exe
C:\Homes\Administrator\Desktop\D\tester\stringtest.d -debug -g -c -unittest
-w -version=OLE_COM
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(10): undefined
identifier module stream.stdout
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(10): undefined
identifier module stream.stdout
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(10): no property
'writeLine' for type 'void'
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(10): function expected
before (), not 1 of type int
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(11): undefined
identifier module stream.stdout
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(11): undefined
identifier module stream.stdout
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(11): no property
'writeLine' for type 'void'
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(11): function expected
before (), not 1 of type int
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(12): undefined
identifier module stream.stdin
C:\Homes\Administrator\Desktop\D\tester\stringtest.d(12): undefined
identifier module stream.stdin
Any ideas? I am using the latest dmd.exe and dmc linker tools, etc. I am
stumped...
regards,
Rob
More information about the Digitalmars-d-learn
mailing list