When you get errors like that, it means that DMD cannot find the import file. If you import foo.bar.xyz
, then it expects it to find a xyz.d
in some directory foo\bar\
.
It searches for this directory in all its standard import paths, as well as the current directory (for example, if you added a directory std
next to your tcpechoserver.d
with a stdio.d
in it, then it would use that). Of course, you don't want that -- you want the standard stdio.d
.
You can find what directories it looks it by opening the file
C:\D\dmd2\windows\bin\sc.ini
(assuming you installed to the default directory).
Inside that, it should contain the line:
DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import"
which is telling the compiler to search those paths when looking for import directories. If you don't have that line for whatever reason (or if the line is different) then try adding this line into sc.ini
(anywhere under the [Environment]
header should do.
Also ensure that the dmd2
directory contains a \src\phobos\std\stdio.d
file.
If both these don't work, then I'd recommend reinstalling from scratch.
dmd -v
. – Tangled