Module stdio cannot read file 'std\stdio.d'

Derek Parnell derek at nomail.afraid.org
Wed May 2 18:17:31 PDT 2007


On Wed, 02 May 2007 20:56:41 -0400, GS Tan wrote:

> I am running MS Windows XP.

So am I.
 
> I have just installed D compiler (dmd.zip) with linkers (dmc.zip)
> and setup the system variables. I tried the test routine: main() {}
> and dmd.exe was able to compiled.
> 
> There are two different directories for compiler (\dmd) and 
> linker (\dm), where readme.txt for for dmd.zip and dmc.zip
> does not specify. Anyway, I included into PATH, the path
> to drive:\dm\include; and drive:\dm\lib.


You do not need to have dm\include or dm\lib in the PATH symbol. You only
need dmd\bin and dm\bin to be in there.
 
> I wrote the program "Hello there" to test out stdio.
> 
> import std.stdio ;
> 
> main()
> {
>    writef ("Hello there!\n") ;
> }

I guess you mean "void main()" ... <g>

> This is the error I see. When I checked \dm\include, I see
> the file "stdio.h" and not "stdio.d". What is the problem?

The D programming language does not use .h (C header files) at all. The
stdio.d should be located in "dmd\src\phobos\std"

> Can you pls help me and maybe advise me as to whether I downloaded the correct file.

Things look okay from your description here.

The message does mean that the compile can't find the stdio.d file though.
The way it knows where to look is that it uses the sc.ini file which should
be in dmd\bin and uses the line ...

   DFLAGS="-I%@P%\..\src\phobos"

The -I switch tells the compiler where to look for import files. In the
standard installation case, the '%@P%' is translated as the path of the DMD
compiler.

Try this ...

  dmd test.d -I<drive>:\dmd\src\phobos



-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
3/05/2007 11:04:50 AM


More information about the Digitalmars-d-learn mailing list