dmd error in wsl2

mw mingwu at gmail.com
Tue May 25 16:15:55 UTC 2021


On Tuesday, 25 May 2021 at 15:54:31 UTC, bharathyes wrote:
> I am facing an issue compiling an hello world program using dmd 
> v2.096.1 running on WSL2 debian.
>
> I wrote the basic code:
>
> ```d
> void main() {
>     import std.studio;
>     string name ;
>     write("What is your name?");
>     readf("%s\n", &name);
>     writeln("Hellow ", name);
> }
> ```
>
> This throws the following no compiling:
>
> ```
> $ dmd hellow.d                                                
> 21:16:13
> hellow.d(2): Error: module `studio` is in file 'std/studio.d' 
> which cannot be read
> import path[0] = /usr/include/dmd/phobos
> import path[1] = /usr/include/dmd/druntime/import
> ```
>
> ---
>
> What is the process to follow here? Is this an permission issue 
> ( since it says cannot be read ) or do I need to add any import 
> statement for this to work?
>
> PS: Not to get off-topic but is using WSL to learn DLang a bad 
> idea to begin with? I am just getting used to WSL + VS Code and 
> trying to stick to it when possible. `cmd` & `powershell` is 
> just a headache for me to use.


I think `powershell` is a Windows thing, which caused the path 
finding trouble. Your better in a Linux shell e.g. `wsl -u root`.

Can you directly use a console from debian? e.g start by clicking 
the app with the icon of Ubuntu.





More information about the Digitalmars-d-learn mailing list