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


Reply via email to