www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Error: module ctype is in file 'std/ctype.d' which cannot be read -

reply Roman <roman.snitko gmail.com> writes:
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.
Jun 24 2016
parent reply Roman <roman.snitko gmail.com> writes:
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.
Jun 24 2016
parent reply cym13 <cpicard openmailbox.org> writes:
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.
Jun 24 2016
parent Roman <roman.snitko gmail.com> writes:
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.
Jun 24 2016