Proc types are {.closure.} by default i.e. fat pointer. You want {.cdecl.}
instead:
type:
VSAPI* {.importc: "struct VSAPI", header: headerVapourSynth, bycopy.} =
object
createCore*: proc(threads:cint):ptr VSCore {.cdecl.}
....
RunAlso as long as you exactly match the struct layout to that of C, you don't need importc and header pragmas for the type, and thus don't depend on the headers at all.
