dub ldc error _d_array_slice_copy

kinke noone at nowhere.com
Mon Feb 18 23:40:20 UTC 2019


On Monday, 18 February 2019 at 19:10:50 UTC, SrMordred wrote:
> dub --compiler=ldc2 //app.d:4: error: undefined reference to 
> '_d_array_slice_copy'

Dub has nothing to do with it, it's the -betterC flag, and LDC 
expecting that druntime function to be available for slice 
copies. Quick workaround: add a manual version (here without any 
checks) somewhere in your code:

extern(C) void _d_array_slice_copy(void* dst, size_t dstlen, 
void* src, size_t srclen, size_t elemsz)
{
         import ldc.intrinsics : llvm_memcpy;
         llvm_memcpy!size_t(dst, src, dstlen * elemsz, 0);
}


More information about the Digitalmars-d-learn mailing list