On Friday, 26 April 2019 at 12:37:46 UTC, evilrat wrote:
On Friday, 26 April 2019 at 05:08:32 UTC, dokutoku wrote:
I tried to build a DLL in a Windows 64bit environment.
It works well if the compiler is DMD, but in the case of LDC,
the build fails with a large number of undefined symbol errors.
Is this a DUB or LDC bug?
Or do I have to specify some additional arguments to the
command?
Seems like DMD links some system and/or runtime libs for you,
while LDC doesn't.
What symbols are missing? It could be just msvcrt and some of
the default system libs such as system32 and the like.
There was an error like this.
```
Performing "debug" build using C:\ldc\bin\ldc2.exe for x86_64.
test ~master: building configuration "library"...
lld-link: error: referenced by
druntime-ldc.lib(exception.obj):(_d_arrayboundsp)
lld-link: error: undefined symbol: __acrt_iob_func
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
lld-link: error: undefined symbol: __stdio_common_vfwprintf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
lld-link: error: undefined symbol: __stdio_common_vfwscanf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
lld-link: error: undefined symbol: __stdio_common_vswprintf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN5)
lld-link: error: undefined symbol: __stdio_common_vswscanf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
lld-link: error: undefined symbol: __stdio_common_vfprintf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
lld-link: error: undefined symbol: __stdio_common_vfscanf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
lld-link: error: undefined symbol: __stdio_common_vsprintf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN5)
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN5)
lld-link: error: undefined symbol: __stdio_common_vsscanf
referenced by
legacy_stdio_definitions.lib(legacy_stdio_definitions.obj):($LN3)
lld-link: error: undefined symbol: strlen
referenced by
druntime-ldc.lib(object.obj):(_D6object10ModuleInfo4nameMxFNaNbNdNiZAya)
lld-link: error: undefined symbol: malloc
referenced by druntime-ldc.lib(lifetime.obj):(_d_newclass)
referenced by
druntime-ldc.lib(lifetime.obj):(_D2rt8lifetime__T11_d_newclassVbi1ZQsFNbxC14TypeInfo_ClassZC6Object)
referenced by druntime-ldc.lib(lifetime.obj):(_d_allocclass)
referenced by
druntime-ldc.lib(lifetime.obj):(_D2rt8lifetime__T11_d_newclassVbi0ZQsFNbxC14TypeInfo_ClassZC6Object)
referenced by
druntime-ldc.lib(lifetime.obj):(_D2rt8lifetime10__blkcacheFNbNdZPS4core6memory8BlkInfo_)
referenced by
druntime-ldc.lib(lifetime.obj):(_D2rt8lifetime12__getBlkInfoFNbPvZPS4core6memory8BlkInfo_)
referenced by
druntime-ldc.lib(lifetime.obj):(_D2rt8lifetime20__insertBlkInfoCacheFNbS4core6memory8BlkInfo_PQxZv)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arrayshrinkfit)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arrayshrinkfit)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetcapacity)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetcapacity)
referenced by druntime-ldc.lib(lifetime.obj):(_d_delarray_t)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthiT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthiT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthiT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthiT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthiT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arraysetlengthiT)
referenced by
druntime-ldc.lib(lifetime.obj):(_d_arrayappendcTX)
reference