Q:

Undefined identifier fwritefln

I'm learning D and having some difficulty with a standard library import.
import std.stdio;

void main(string[] args) {
    fwritefln(stderr, "foo");
}

Compiling with "gdc foo.d" produces the following error
foo.d:4: error: undefined identifier fwritefln, did you mean template writefln(T...)(T args)?

I can't figure out what I'm doing wrong.  Most library imports I've tried, I've had no difficulty with, but for some reason, this "fwritefln" is a problem.

A:

Try this:
stderr.writefln(...);

This is the D's equivalent to C's fprintf(stderr, ...)
Every OutputStream has set of writef* methods that can be used to send formatted strings. More about it here: http://dlang.org/phobos/std_stream.html#.OutputStream.writef

