# 'initInterface' is not a member function

**URL:** <https://ziggit.dev/t/initinterface-is-not-a-member-function/16862>\
**Category:** Help\
**Tags:** standard-library\
**Created:** [July 22, 2026, 7:54pm UTC](https://ziggit.dev/t/initinterface-is-not-a-member-function/16862 "2026-07-22T19:54:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![whatToUseThisFor](https://ziggit.dev/letter_avatar_proxy/v4/letter/w/ac91a4/32.png) [@whatToUseThisFor](https://ziggit.dev/u/whatToUseThisFor)\
**Post date:** [July 22, 2026, 7:54pm UTC](https://ziggit.dev/t/initinterface-is-not-a-member-function/16862/1 "2026-07-22T19:54:12Z")

</div>

(I’m js now getting into zig / systems programming in general, so sry for any egregious mistakes lol)

I’m writing a brainfsck-to-zig transpiler, and for the ‘.’ command, I wrote this:

```zig
// the buffer is defined above with "var buffer: [3]u8 = @splat(undefined);"
std.Io.File.stdout().writer(init.io, &buffer).initInterface(buffer).print("{d}", .{tape.items[pointer]});

```

However, upon compiling the output from a hello world bf program, I get this error message:

```zig
test.zig:110:50: error: no field or member function named 'initInterface' in 'Io.File.Writer'
    std.Io.File.stdout().writer(init.io, &buffer).initInterface(buffer).print("{d}", .{tape.items[pointer]});
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
C:\Users\thebo\AppData\Roaming\VSCodium\User\globalStorage\ziglang.vscode-zig\zig\x86_64-windows-0.17.0-dev.864+3deb86baf\lib\std\Io\File\Writer.zig:1:1: note: struct declared here
const Writer = @This();
^ ~~~~
C:\Users\thebo\AppData\Roaming\VSCodium\User\globalStorage\ziglang.vscode-zig\zig\x86_64-windows-0.17.0-dev.864+3deb86baf\lib\std\Io\File\Writer.zig:67:5: note: 'initInterface' is not a member function
pub fn initInterface(buffer: []u8) Io.Writer {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

In the zig std docs though, the “initInterface” function is included with std.Io.File.Writer

What’s going on?

---

<div class="post-metadata">

**Author:** ![abdullah-b-al](https://ziggit.dev/user_avatar/ziggit.dev/abdullah-b-al/32/4601_2.png) [@abdullah-b-al](https://ziggit.dev/u/abdullah-b-al)\
**Post date:** [July 22, 2026, 8:12pm UTC](https://ziggit.dev/t/initinterface-is-not-a-member-function/16862/2 "2026-07-22T20:12:12Z")

</div>

`std.Io.File.stdout().writer(init.io, &buffer)` returns a value of type `std.Io.File.Writer`. `initInterface` is a function and not a method, when you call `writer().initInterface` the compiler assumes there’s a method with that name and it can’t find it, hence the message `no member function`. You can only access the function by doing `std.Io.File.Writer.initInterface`. But, that’s unnecessary as `std.Io.File.stdout().writer(init.io, &buffer)` is the init method you want. The correct usage is

```zig
var writer = std.Io.File.stdout().writer(init.io, &buffer); // init the writer
try writer.interface.print("hello :D", .{});

```

Note the interface field. Due to implementation details you should always use the interface as `writer.interface` or you can place it into a variable by taking a pointer to it.  
`const interface = &writer.interface;`  
Otherwise you’ll have a bad time.

As a side note `@splat(undefined)` can be simplified to just `undefined`

---

<div class="post-metadata">

**Author:** ![abdullah-b-al](https://ziggit.dev/user_avatar/ziggit.dev/abdullah-b-al/32/4601_2.png) [@abdullah-b-al](https://ziggit.dev/u/abdullah-b-al)\
**Post date:** [July 22, 2026, 8:17pm UTC](https://ziggit.dev/t/initinterface-is-not-a-member-function/16862/3 "2026-07-22T20:17:34Z")

</div>

For an in depth review check [File I/O basics (0.16)](https://ziggit.dev/t/file-i-o-basics-0-16/14968)
