theo ❯❯ bun src/example.ts
56 | break;
57 | }
58 | }
59 | return wrap.native = functionToCall, wrap.ptr = functionToCall.ptr, wrap;
60 |
61 | }, dlopen = function(path, options) {
^
TypeError: undefined is not an object
at bun:ffi:61:40
at /home/theo/dev/gurafikku/src/index.ts:5:26
import { dlopen, FFIType, ptr, suffix } from "bun:ffi";
const path = `libdawn.${suffix}`;
const { symbols: dawn } = dlopen(path, {
wgpuCreateInstance: {
args: [FFIType.pointer],
returns: FFIType.pointer,
},
wgpuInstanceRelease: {
args: [FFIType.pointer],
returns: FFIType.void,
},
});
The libdawn.so is in zig-out/lib and i tried using LD_LIBRARY_PATH=$PWD/zig-out/lib to point to it but that didnt help 🤔
