Dlang Wasm 库编译错误: 'object._d_arrayappendcTXImpl' 未找到
在使用 Dlang Wasm 库 (https://github.com/adamdruppe/webassembly/) 进行编译时,可能会遇到以下错误:
'arsd-webassembly/core/internal/utf.d(398): Error: object._d_arrayappendcTXImpl not found. The current runtime does not support appending element to arrays, or the runtime is corrupt.'
'arsd-webassembly/core/internal/utf.d(430): Error: function object._d_arrayappendT(const(TypeInfo) ti, ref byte[] x, byte[] y) is not callable using argument types (char[], char[])
too few arguments, expected 3, got 2'
'arsd-webassembly/core/internal/utf.d(467): Error: object._d_arrayappendcTXImpl not found. The current runtime does not support appending element to arrays, or the runtime is corrupt.'
'arsd-webassembly/core/internal/utf.d(475): Error: function object._d_arrayappendT(const(TypeInfo) ti, ref byte[] x, byte[] y) is not callable using argument types (wchar[], wchar[])
too few arguments, expected 3, got 2'
'arsd-webassembly/core/internal/utf.d(489): Error: object._d_arrayappendcTXImpl not found. The current runtime does not support appending element to arrays, or the runtime is corrupt.'
'arsd-webassembly/core/internal/utf.d(694): Error: object._d_arrayappendcTXImpl not found. The current runtime does not support appending element to arrays, or the runtime is corrupt.'
'arsd-webassembly/core/internal/utf.d(727): Error: object._d_arrayappendcTXImpl not found. The current runtime does not support appending element to arrays, or the runtime is corrupt.'
'arsd-webassembly/core/internal/utf.d(735): Error: object._d_arrayappendcTXImpl not found. The current runtime does not support appending element to arrays, or the runtime is corrupt.'
'arsd-webassembly/object.d(1985): Error: function object._d_arrayappendT(const(TypeInfo) ti, ref byte[] x, byte[] y) is not callable using argument types (string, string)
too few arguments, expected 3, got 2'
'arsd-webassembly/object.d(1985): Error: none of the overloads of toString are callable using argument types (void)
Candidates are: object.Throwable.toString()
object.Throwable.toString(scope void delegate(in char[]) sink)
这个错误通常是由于使用了不支持在数组中添加元素的运行时环境导致的,可能是因为使用了不正确的编译器或编译选项。
解决方案:
- 使用支持数组添加元素的编译器或编译选项: 检查你的 Dlang 编译器版本和编译选项,确保它们支持 Wasm 库的功能。
- 更新编译器或编译选项: 如果你的编译器或编译选项版本过旧,请尝试更新到最新版本。
- 联系项目维护者: 如果问题仍然存在,可以联系项目的维护者(https://github.com/adamdruppe/webassembly/issues)或提交一个问题报告以获取更多帮助。
相关文件:
- https://github.com/adamdruppe/webassembly/blob/master/arsd-webassembly/object.d
原文地址: https://www.cveoy.top/t/topic/ozqc 著作权归作者所有。请勿转载和采集!