Hello everyone. am working on something with SNMP and i wanted to use the ASN1 module from the std lib however when i tried to run this example i got this error message
pub fn main(init: std.process.Init) !void {
const arena = init.arena;
defer arena.deinit();
const allocator = arena.allocator();
const num: i32 = 20;
var encoder = asn1.der.Encoder.init(allocator);
try encoder.any(num);
}
Error:
❯ zig build run
run
└─ run exe nsa1
└─ compile exe nsa1 Debug native 1 errors
/home/misabear/.zvm/0.16.0/lib/std/crypto/codecs/asn1/der/Encoder.zig:120:47: error: root source file struct 'crypto.codecs.asn1.der.ArrayListReverse' has no member named 'Writer'
pub fn writer(self: *Encoder) ArrayListReverse.Writer {
~~~~~~~~~~~~~~~~^~~~~~~
/home/misabear/.zvm/0.16.0/lib/std/crypto/codecs/asn1/der/ArrayListReverse.zig:1:1: note: struct declared here
//! An ArrayList that grows backwards. Counts nested prefix length fields
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
length: /home/misabear/.zvm/0.16.0/lib/std/crypto/codecs/asn1/der/Encoder.zig:97:25
anyTag__anon_33014: /home/misabear/.zvm/0.16.0/lib/std/crypto/codecs/asn1/der/Encoder.zig:74:20
7 reference(s) hidden; use '-freference-trace=9' to see all references
error: 1 compilation errors
failed command: /home/misabear/.zvm/0.16.0/zig build-exe -ODebug --dep nsa1 -Mroot=/home/misabear/Desktop/zig/nsa1/src/main.zig -Mnsa1=/home/misabear/Desktop/zig/nsa1/src/root.zig --cache-dir .zig-cache --global-cache-dir /home/misabear/.cache/zig --name nsa1 --zig-lib-dir /home/misabear/.zvm/0.16.0/lib/ --listen=-
Build Summary: 0/5 steps succeeded (1 failed)
run transitive failure
└─ run exe nsa1 transitive failure
├─ compile exe nsa1 Debug native 1 errors
└─ install transitive failure
└─ install nsa1 transitive failure
└─ compile exe nsa1 Debug native (reused)
error: the following build command failed with exit code 1:
.zig-cache/o/9dab6a593ececf3d3e8266548ab46aee/build /home/misabear/.zvm/0.16.0/zig /home/misabear/.zvm/0.16.0/lib /home/misabear/Desktop/zig/nsa1 .zig-cache /home/misabear/.cache/zig --seed 0x1abdc0b -Z50d67263d7e3b5b0 run
is the ASN broken or am i doing something wrong ??