Closed lynn closed 2 years ago
hmm - what version of clang do you have? It could be a mismatch between libclang-bindings
and your actual libclang.dll
. Here's what I get when I run your test with this branch:
import ffi from "ffi-napi";
import ref, { Pointer as TypedPointer, UnderlyingType } from "ref-napi";
import refStructDi, { StructObject } from "ref-struct-di";
import refArrayDi, { TypedArray } from "ref-array-di";
const Struct = refStructDi(ref);
const Array = refArrayDi(ref);
const Pointer = ref.refType;
export enum MyEnum {
MY_ENUM_FOO = 1,
MY_ENUM_BAR = 2,
}
export const MyEnumDef = ref.types.int;
export function dlopen(libPath: string) {
return ffi.Library(libPath, {});
}
I have:
λ clang --version
clang version 13.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
For even more context - If this ends up being due to clang versions - I'd like to add packages that wrap their releases (or get them on postInstall
) - just haven't gotten around to it. But that would be a big win for a few reasons:
Making a draft for this, because it's finished in theory but I can't test it 😅
I get a crash like so:
on every invocation of clangffi. Have you ever seen this @bengreenier?