'fopen64 cannot be interpreted at compile time' for __gshared File

crimaniak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 25 08:52:15 PDT 2017


Simple File test:

     void main()
     {
         import std.stdio;

         File f = File("test.txt", "w");

         f.writeln("hello");
     }

All works as expected.

Now let's add __gshared:

     void main()
     {
         import std.stdio;

         __gshared File f = File("test.txt", "w");

         f.writeln("hello");
     }

Now we have:

/usr/include/dmd/phobos/std/stdio.d(3797): Error: fopen64 cannot 
be interpreted at compile time, because it has no available 
source code
/usr/include/dmd/phobos/std/stdio.d(3804):        called from 
here: fopenImpl(namez.ptr(), modez.ptr())
/usr/include/dmd/phobos/std/stdio.d(404):        called from 
here: fopen(name, stdioOpenmode)
/usr/include/dmd/phobos/std/stdio.d(404):        called from 
here: errnoEnforce(fopen(name, stdioOpenmode), delegate string() 
=> text("Cannot open file `", name, "' in mode `", stdioOpenmode, 
"'"))
/usr/include/dmd/phobos/std/stdio.d(404):        called from 
here: this.this(errnoEnforce(fopen(name, stdioOpenmode), delegate 
string() => text("Cannot open file `", name, "' in mode `", 
stdioOpenmode, "'")), name, 1u, false)
file.d(5):        called from here: ((File __slFile648 = 
File(null, null);) , __slFile648).this("test.txt", "w")

Oooops! Who can explain this error message to me?

DMD64 D Compiler v2.073.0




More information about the Digitalmars-d-learn mailing list