Thread overview
Module stdio cannot read file 'std\stdio.d'
May 03, 2007
GS Tan
May 03, 2007
Derek Parnell
May 03, 2007
GS Tan
May 03, 2007
BCS
May 07, 2007
GS Tan
May 03, 2007
I am running MS Windows XP.

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.

I wrote the program "Hello there" to test out stdio.

import std.stdio ;

main()
{
   writef ("Hello there!\n") ;
}

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?

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

Thanks..GS
May 03, 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
May 03, 2007
Thanks for your reply Derek. Appreciate your reply. I went to \dmd\bin and checked sci.ini. The -I switch is there. This is the sci.ini file content:

[Version]
version=7.51 Build 020

[Environment]
LIB="%@P%\..\lib";\dm\lib
DFLAGS="-I%@P%\..\src\phobos"
LINKCMD=%@P%\..\..\dm\bin\link.exe

Is there another other way to direct the compiler to the stdio library?

Appreciate your help to get me started. Thanks..GS


Derek Parnell Wrote:

> 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

May 03, 2007
Reply to GS,

> Thanks for your reply Derek. Appreciate your reply. I went to \dmd\bin
> and checked sci.ini. The -I switch is there. This is the sci.ini file
> content:
> 

the file should be "sc.ini" not "sci.ini" that might be your problem right there.

> [Version]
> version=7.51 Build 020
> [Environment]
> LIB="%@P%\..\lib";\dm\lib
> DFLAGS="-I%@P%\..\src\phobos"
> LINKCMD=%@P%\..\..\dm\bin\link.exe

I'd hard code the paths. If things don't move it is a little more reliable.

LIB=c:\dmd\lib;c:\dm\lib
DFLAGS="-Ic:\dmd\src\phobos"
LINKCMD=c:\dm\bin\link.exe

> Is there another other way to direct the compiler to the stdio
> library?
> 

you can have more than one sc.ini

http://www.digitalmars.com/d/dcompiler.html#sc_ini


May 07, 2007
BCS Wrote:

> Reply to GS,
> 
> > Thanks for your reply Derek. Appreciate your reply. I went to \dmd\bin and checked sci.ini. The -I switch is there. This is the sci.ini file content:
> > 
> 
> the file should be "sc.ini" not "sci.ini" that might be your problem right there.
> 
> > [Version]
> > version=7.51 Build 020
> > [Environment]
> > LIB="%@P%\..\lib";\dm\lib
> > DFLAGS="-I%@P%\..\src\phobos"
> > LINKCMD=%@P%\..\..\dm\bin\link.exe
> 
> I'd hard code the paths. If things don't move it is a little more reliable.
> 
> LIB=c:\dmd\lib;c:\dm\lib
> DFLAGS="-Ic:\dmd\src\phobos"
> LINKCMD=c:\dm\bin\link.exe
> 
> > Is there another other way to direct the compiler to the stdio library?
> > 
> 
> you can have more than one sc.ini
> 
> http://www.digitalmars.com/d/dcompiler.html#sc_ini
> 
> 
Thanks. I will try it out. Will inform you of the result.

..GS