www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.stdio not found?

reply akcom <CppCoder gmail.com> writes:
module Test;

import std.stdio;
//import std.c.stdio;

int main( char [][]args )
{
	for ( int i = 0; i < args.length; i++ )
	{
		writefln( "argument[%u] = \"%s\"\n", i, cast( char * )args[i] );
	}
	return 0;
}

when I try to compile that, I get the following error: "module stdio
cannot read file 'std\stdio.d'
when I comment out the first import statement and uncomment the second,
I am told that writefln is undefined, any ideas?
Dec 27 2005
parent reply akcom <CppCoder gmail.com> writes:
akcom wrote:
 module Test;
 
 import std.stdio;
 //import std.c.stdio;
 
 int main( char [][]args )
 {
 	for ( int i = 0; i < args.length; i++ )
 	{
 		writefln( "argument[%u] = \"%s\"\n", i, cast( char * )args[i] );
 	}
 	return 0;
 }
 
 when I try to compile that, I get the following error: "module stdio
 cannot read file 'std\stdio.d'
 when I comment out the first import statement and uncomment the second,
 I am told that writefln is undefined, any ideas?
I forgot to mention that I was using Ares, I'm assuming that is the problem? (not to mention I just found out I don't have to use char pointer cast)
Dec 27 2005
next sibling parent Derek Parnell <derek psych.ward> writes:
On Tue, 27 Dec 2005 17:49:12 -0500, akcom wrote:

 akcom wrote:
 module Test;
 
 import std.stdio;
 //import std.c.stdio;
 
 int main( char [][]args )
 {
 	for ( int i = 0; i < args.length; i++ )
 	{
 		writefln( "argument[%u] = \"%s\"\n", i, cast( char * )args[i] );
 	}
 	return 0;
 }
 
 when I try to compile that, I get the following error: "module stdio
 cannot read file 'std\stdio.d'
 when I comment out the first import statement and uncomment the second,
 I am told that writefln is undefined, any ideas?
I forgot to mention that I was using Ares, I'm assuming that is the problem? (not to mention I just found out I don't have to use char pointer cast)
I can't help you with the Ares problem. Does it work when *not* using Ares? Also, here is a more "D"-ish version of your code... import std.stdio; int main( char [][]args ) { foreach ( int i, char[] s; args ) { writefln( `argument[%d] = "%s"`, i, s ); } return 0; } -- Derek (skype: derek.j.parnell) Melbourne, Australia "A learning experience is one of those things that says, 'You know that thing you just did? Don't do that.'" - D.N. Adams 28/12/2005 10:13:43 AM
Dec 27 2005
prev sibling parent John Reimer <terminal.node gmail.com> writes:
akcom wrote:
 akcom wrote:
 module Test;

 import std.stdio;
 //import std.c.stdio;

 int main( char [][]args )
 {
 	for ( int i = 0; i < args.length; i++ )
 	{
 		writefln( "argument[%u] = \"%s\"\n", i, cast( char * )args[i] );
 	}
 	return 0;
 }

 when I try to compile that, I get the following error: "module stdio
 cannot read file 'std\stdio.d'
 when I comment out the first import statement and uncomment the second,
 I am told that writefln is undefined, any ideas?
I forgot to mention that I was using Ares, I'm assuming that is the problem? (not to mention I just found out I don't have to use char pointer cast)
I don't think Ares contains the function writefln, at the moment. -JJR
Dec 27 2005