Thread overview
Error: module ctype is in file 'std/ctype.d' which cannot be read - when running dmd
Jun 24, 2016
Roman
Jun 24, 2016
Roman
Jun 24, 2016
cym13
Jun 24, 2016
Roman
June 24, 2016
I've just tried to compile a program with `rdmd`, but get the following error:

    count_words.d(1): Error: module ctype is in file 'std/ctype.d' which cannot be read
    import path[0] = .
    import path[1] = /home/roman/dlang/dmd-2.071.0/linux/bin64/../../src/phobos
    import path[2] = /home/roman/dlang/dmd-2.071.0/linux/bin64/../../src/druntime/import

The error is due to the `import std.ctype` statement that I have. If I remove everything else from the file and leave just that, the error persists, so it's clearly the only reason why I'm getting this error.

A quick Google search led me to this old thread: http://forum.dlang.org/thread/imn3fg$2nve$1@digitalmars.com, however it seems the issues wasn't resolved for that person. It looks like I'm having the same issue.

To further explain the situation:

1. I'm on Ubuntu 16.04

2. I've installed D with the installation script `curl -fsS https://dlang.org/install.sh | bash -s dmd` from here https://dlang.org/download.html

3. I've followed the installation script suggestion and ran `source ~/dlang/dmd-2.071.0/activate`

4. Both dirs that show up in the error output do exist and contain files and other dirs. I haven't changed anything, the installation script put it there.

And it doesn't work. Would appreciate any help.
June 24, 2016
I should probably add that only importing std.ctype causes the error.
I have a bunch of other imports:

    import std.stdio, std.string, std.algorithm, std.conv, std.ctype, std.regex, std.range;

If I remove std.ctype, it compiles just fine.
June 24, 2016
On Friday, 24 June 2016 at 21:01:11 UTC, Roman wrote:
> I should probably add that only importing std.ctype causes the error.
> I have a bunch of other imports:
>
>     import std.stdio, std.string, std.algorithm, std.conv, std.ctype, std.regex, std.range;
>
> If I remove std.ctype, it compiles just fine.

std.ctype (as well as other c-specific bindings) was moved to core.stdc so just replace std.ctype by core.stdc.ctype and it should work as intended.
June 24, 2016
On Friday, 24 June 2016 at 21:06:30 UTC, cym13 wrote:
> On Friday, 24 June 2016 at 21:01:11 UTC, Roman wrote:
>> I should probably add that only importing std.ctype causes the error.
>> I have a bunch of other imports:
>>
>>     import std.stdio, std.string, std.algorithm, std.conv, std.ctype, std.regex, std.range;
>>
>> If I remove std.ctype, it compiles just fine.
>
> std.ctype (as well as other c-specific bindings) was moved to core.stdc so just replace std.ctype by core.stdc.ctype and it should work as intended.

Thank you, that worked.