RainwayApp / node-clangffi

Generate Typescript FFI bindings for C/C++ libraries using libclang and ffi-napi.
MIT License
7 stars 1 forks source link

Appears to not ever load `libclang` on my system. What can I do? #60

Open hperrin opened 2 years ago

hperrin commented 2 years ago

How exactly do I need to provide libclang? Is it libclang.so or a binary named libclang? I've built LLVM on my system and provided both its libclang.so and the one in PATH, but I still can't get any more output than what's below. It seems like clangffi isn't using the libclang I'm providing.

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";
import refUnionDi from "ref-union-di";
const Struct = refStructDi(ref);
const Union = refUnionDi(ref);
const ArrayType = refArrayDi(ref);
const Pointer = ref.refType;
export function dlopen(libPath: string) {
  return ffi.Library(libPath, {});
}