我需要在节点 js 的 dll 文件中调用一个函数。我正在尝试在 ubuntu 15.04 中使用 edge.js。
我使用以下网址上的说明安装了单声道:
然后我使用以下方法安装了边缘:
npm install edge
我正在尝试调用 dll 中的函数。为此,我使用以下 nodejs 代码包含了 dll:
var ed = require('edge').func('Sample.dll');
但它抛出以下错误:
Error: No managed allocator, but we need one for AOT.
Are you using non-standard GC options?
Stacktrace:
at <unknown> <0xffffffff>
at System.Globalization.CultureInfo..cctor () <0x00014>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0x00062>
at <unknown> <0xffffffff>
at System.IO.FileNotFoundException.SetMessageField () <0x00071>
at System.IO.FileNotFoundException.get_Message () <0x0000c>
at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <0x00069>
Native stacktrace:
/usr/lib/libmonosgen-2.0.so.1(+0xdac0d) [0x7f527a291c0d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7f527ad54d10]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f527a9af267]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f527a9b0eca]
/usr/lib/libmonosgen-2.0.so.1(+0x26c1e9) [0x7f527a4231e9]
/usr/lib/libmonosgen-2.0.so.1(+0x26c3f7) [0x7f527a4233f7]
/usr/lib/libmonosgen-2.0.so.1(+0x26c4a2) [0x7f527a4234a2]
/usr/lib/libmonosgen-2.0.so.1(+0xc6170) [0x7f527a27d170]
/usr/lib/libmonosgen-2.0.so.1(+0xc91f4) [0x7f527a2801f4]
/usr/lib/libmonosgen-2.0.so.1(+0xcfefb) [0x7f527a286efb]
/usr/lib/libmonosgen-2.0.so.1(+0xdccdd) [0x7f527a293cdd]
[0x4062ec15]
Debug info from gdb:
No threads.
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Aborted (core dumped)