Re: DLL creation fails with undefined symbol error

2019-05-11 Thread kinke via Digitalmars-d-learn

On Friday, 26 April 2019 at 05:08:32 UTC, dokutoku wrote:

Is this a DUB or LDC bug?


It's a combination of at least 3 small bugs in the MinGW-w64 
based libraries and should be fixed by 
https://github.com/ldc-developers/ldc/pull/3071.


Re: DLL creation fails with undefined symbol error

2019-04-29 Thread Kagamin via Digitalmars-d-learn

fwrite, fputc - that's missing C library.


Re: DLL creation fails with undefined symbol error

2019-04-26 Thread evilrat via Digitalmars-d-learn

On Friday, 26 April 2019 at 14:20:24 UTC, dokutoku wrote:


Error: linking with LLD failed
C:\ldc\bin\ldc2.exe failed with exit code 1.



Ok, I have Visual Studio and SDKs installed so it works for me 
without touching anything else.
In your case it is using lld linker instead, and I have no idea 
what libs it requires.


Re: DLL creation fails with undefined symbol error

2019-04-26 Thread dokutoku via Digitalmars-d-learn

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)

Re: DLL creation fails with undefined symbol error

2019-04-26 Thread evilrat via Digitalmars-d-learn

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.


DLL creation fails with undefined symbol error

2019-04-25 Thread dokutoku via Digitalmars-d-learn

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?